CSS Basic Sheet
Basic CSS Questions:
- What is CSS and why is it used?
- How do you link a CSS file to an HTML file?
- What is the difference between inline, internal, and external CSS?
- How can you apply multiple classes to an HTML element?
- What is the CSS box model? Explain its components.
- How do you center a block element horizontally?
- What is the difference between
margin
andpadding
? - How do you create a CSS rule that applies to all
<p>
elements? - What are CSS selectors? List some common selectors.
- How can you apply styles to a class and an ID in CSS?
- Explain the concept of specificity in CSS.
- What are pseudo-classes and pseudo-elements in CSS? Give examples.
- How can you make a list horizontal using CSS?
- What is the
z-index
property and how is it used? - How can you make a website responsive using CSS?
- What is a CSS reset? Why is it used?
- Explain the difference between
absolute
,relative
,fixed
, andsticky
positioning. - How do you use
float
andclear
properties in CSS? - What is the
display
property in CSS and what are its possible values? - How do you hide an element in CSS?
Intermediate CSS Questions:
- What is Flexbox and how do you use it?
- Explain the CSS Grid layout and its advantages over Flexbox.
- How do you create a grid layout with CSS Grid?
- What is the
::before
and::after
pseudo-elements? Provide examples. - How do you create a responsive navigation bar using CSS?
- What are media queries and how do they work?
- How do you use CSS transitions? Give an example.
- Explain CSS animations and keyframes.
- How can you create a gradient background in CSS?
- What are CSS preprocessors? Explain the use of SASS or LESS.
- What is the difference between
em
andrem
units in CSS? - How do you create a CSS variable and use it?
- Explain the concept of
clipping
in CSS. - How can you create a CSS shape like a circle or triangle?
- What is the
box-sizing
property and how does it affect the box model? - How do you apply a shadow to an element using CSS?
- What is the
overflow
property and how is it used? - How do you create a tooltip using CSS?
- What are the different ways to apply custom fonts in CSS?
- How can you create a responsive image gallery using CSS?
Advanced CSS Questions:
- Explain the concept of CSS specificity and how to calculate it.
- What is the
@supports
rule in CSS? - How can you create complex animations using CSS?
- What is the
calc()
function in CSS and how is it used? - How do you handle browser compatibility issues in CSS?
- Explain the use of
will-change
property in CSS. - What is the
content-visibility
property and how does it improve performance? - How can you use CSS to create a parallax scrolling effect?
- What is the difference between
visibility
andopacity
properties? - Explain the concept of CSS Houdini and its potential impact on web development.
- How do you use the
@font-face
rule in CSS? - What is the
backface-visibility
property used for in CSS? - Explain the concept of
min-width
andmax-width
in responsive design. - How can you create a fixed header that stays at the top of the page using CSS?
- What is the difference between
nth-child
andnth-of-type
selectors? - How do you use the
pointer-events
property in CSS? - How can you create a CSS-only dropdown menu?
- Explain the concept of the CSS
cascade
and how it affects the application of styles. - How do you use the
filter
property in CSS? - What are the differences between CSS
transition
andanimation
properties? - What is the
clip-path
property and how do you use it? - How can you create a CSS grid layout with fixed and flexible columns?
- What is the
object-fit
property and how is it used with images and videos? - How do you create a custom scrollbar using CSS?
- Explain the concept of CSS logical properties and values.
- How do you create a multi-column layout using CSS?
- What is the
:focus-within
pseudo-class and how is it used? - How do you use the
scroll-snap
properties in CSS? - What is the
mix-blend-mode
property and how do you use it? - How can you create a CSS-only modal popup?
Expert CSS Questions:
- Explain the concept of CSS Grid areas and how to use them.
- How can you create a responsive layout using CSS Grid and Flexbox together?
- What is the
contain
property in CSS and how does it improve performance? - How do you use the
:target
pseudo-class to create in-page navigation? - What are CSS functions like
var()
,attr()
, andenv()
? Provide examples. - How do you implement a dark mode switch using CSS custom properties?
- What is the
is()
pseudo-class and how does it simplify writing CSS selectors? - How can you create a 3D effect using CSS transforms and perspectives?
- What is the
aspect-ratio
property and how do you use it in responsive design? - How do you create a responsive typography scale using CSS?
- How do you write maintainable and scalable CSS code?
- What are some common CSS naming conventions, like BEM, and why are they used?
- How do you optimize CSS for performance?
- What are the best practices for organizing and structuring CSS files?
- How do you handle large CSS projects and manage CSS dependencies?
- What are CSS architecture methodologies like OOCSS, SMACSS, and ITCSS?
- How do you debug CSS issues effectively?
- What are some common CSS pitfalls and how do you avoid them?
- How do you use CSS in a component-based framework like React or Vue?
- How do you ensure accessibility (a11y) in your CSS design?
CSS Tools and Frameworks:
- What are CSS frameworks like Bootstrap, and how do they simplify development?
- How do you use CSS-in-JS libraries like styled-components or Emotion?
- What is Tailwind CSS and how does it differ from traditional CSS frameworks?
- How do you integrate CSS with modern build tools like Webpack or Parcel?
- What is PostCSS and how does it extend CSS with plugins?
- How do you use CSS Modules in a project?
- What are the advantages of using a CSS preprocessor like Sass or LESS?
- How do you implement CSS theming in a web application?
- What is the purpose of CSS linting tools, and how do you use them?
- How do you use CSS to create adaptive designs for different devices and screen sizes?
These additional questions should provide a thorough coverage of CSS concepts, techniques, and best practices.