1.
CSS Basics
- 2.
How do you include CSS in your HTML document?
- 3.
Can you explain the difference between class and ID selectors?
- 4.
What are pseudo-classes in CSS?
- 5.
Describe how to implement a CSS reset and why it is useful.
Selectors and Combinators
- 6.
How do you select elements by attribute in CSS?
- 7.
What is a pseudo-element, and what are they used for?
- 8.
Explain the difference between the child combinator and the descendant combinator.
- 9.
How would you select all direct children elements of a particular type?
- 10.
What are the universal selector and the sibling combinator, and when would you use them?
Box Model and Layout
- 11.
What is the CSS Box Model?
- 12.
Explain margin collapsing.
- 13.
What are the different values for the box-sizing property and what do they do?
- 14.
How do you center a block element with CSS?
- 15.
What is the difference between block, inline, and inline-block elements?
Positioning and Stacking Contexts
- 16.
Explain the different values for the position property.
- 17.
Describe z-index and how stacking order is controlled in CSS.
- 18.
How do you create a sticky footer with CSS?
- 19.
Can you explain how to create a fixed header that remains at the top on scroll?
- 20.
When would you use position: sticky?
Styling Text and Fonts
- 21.
How do you change the font of text in CSS?
- 22.
What is a web-safe font?
- 23.
When would you use a font shorthand property?
- 24.
How can you include and use custom fonts on a webpage?
- 25.
What is the difference between em and rem units?
Colors, Backgrounds, and Gradients
- 26.
How do you add a background image to an element?
- 27.
What is the difference between hex codes, RGB, and named color values?
- 28.
What are alpha transparency and RGBA?
- 29.
How do you create a gradient background with CSS?
- 30.
Explain how to implement multiple backgrounds on a single element.
Flexbox
- 31.
Describe Flexbox and its advantages.
- 32.
How does flex-grow work?
- 33.
Explain the difference between justify-content and align-items.
- 34.
When would you use align-self?
- 35.
How do you create equal-width columns using Flexbox?
CSS Grid
- 36.
What is the CSS Grid layout, and why is it useful?
- 37.
How do you define grid columns and rows?
- 38.
What is the difference between grid-template-areas and grid-template-columns?
- 39.
How do you place items in the CSS Grid layout?
- 40.
How is overlapping of grid items handled in CSS Grid?
Responsive Design and Media Queries
- 41.
What is a media query?
- 42.
How does the viewport meta tag assist with mobile responsive designs?
- 43.
Describe how to create a mobile-first responsive design.
- 44.
How can you build a layout that changes from a two-column to a single-column with media queries?
- 45.
Explain the use of min-width and max-width in media queries.
Transitions and Animations
- 46.
How do you create a CSS transition?
- 47.
What is the difference between a CSS transition and animation?
- 48.
How do you animate an item’s entrance and exit on the page?
- 49.
Can you explain how to use @keyframes?
- 50.
How do you set the timing functions in CSS animations?
Advanced CSS Techniques
- 51.
What is a CSS preprocessor and why would you use one?
- 52.
Describe the importance of using CSS variables (custom properties).
- 53.
How do you use CSS modules?
- 54.
Can you explain the concept of CSS-in-JS?
- 55.
What tools would you use for CSS linting and formatting?
Styling Forms and User Interfaces
- 56.
How do you style a submit button to appear as a regular link?
- 57.
How can you create custom checkboxes and radio buttons with CSS?
- 58.
Describe how to style a dropdown select box without JavaScript.
- 59.
What is the best practice for styling placeholder text of an input field?
- 60.
How do you implement focus styles for accessibility?
Layout Debugging and Troubleshooting
- 61.
How do you diagnose and solve layout issues?
- 62.
Can you explain how to fix a layout that has unexpectedly broken columns?
- 63.
Describe approaches to resolving common browser compatibility issues in CSS.
- 64.
How would you determine which styles are applied to an element when multiple styles collide?
- 65.
What common CSS problems might cause performance issues?
CSS 3D Transforms and Visual Effects
- 66.
How do you utilize 3D transforms in CSS?
- 67.
Explain how to use the perspective property in CSS.
- 68.
What is backface visibility?
- 69.
How do you create a flip card effect using CSS?
- 70.
What are some examples of visual effects you can achieve with CSS filters?
Layout and Design Principles
- 71.
What are the principles of responsive web design?
- 72.
How would you approach designing a grid system with CSS?
- 73.
Describe the principle of “mobile-first” design.
- 74.
What are some techniques for maintaining aspect ratios in responsive designs?
- 75.
How do you ensure your design is accessible and inclusive?
Print Stylesheets and CSS for Print
- 76.
How do you create a print stylesheet for your web page?
- 77.
What are the common best practices when creating CSS for print?
- 78.
Explain the use of page-break in CSS.
- 79.
How can you test the print version of your web page?
- 80.
What are some challenges when designing CSS for print?
Pseudo-Elements and Pseudo-Classes
- 81.
Describe the purpose of the
::before
and::after
pseudo-elements. - 82.
What is the
:hover
pseudo-class and how does it work? - 83.
Explain the difference between
:nth-child
and:nth-of-type
. - 84.
How do
:first-child
and:last-child
work? - 85.
What is the
:not
pseudo-class and when would you use it?
CSS Performance Optimization
- 86.
How does the complexity of selectors impact performance?
- 87.
What strategies would you use to optimize the rendering path of CSS?
- 88.
How do you minimize CSS repaints and reflows?
- 89.
What are some of the best practices for writing efficient CSS?
- 90.
How do you optimize CSS for critical rendering path and fast load times?
Scalable and Maintainable CSS
- 91.
What is Object-Oriented CSS (OOCSS)?
- 92.
Can you explain the BEM (Block Element Modifier) naming convention?
- 93.
What are the advantages of using a CSS framework like Bootstrap or TailwindCSS?
- 94.
How do you ensure CSS scalability and maintainability in a large project?
- 95.
What are some CSS architecture approaches for large-scale applications?
CSS Special Cases and Practical Scenarios
- 96.
How would you create a CSS-only hamburger menu toggle?
- 97.
Explain how to make a pure CSS carousel or slider.
- 98.
How do you create a masonry layout with CSS?
- 99.
How would you apply CSS to a web application that should print as well as display on screen?
- 100.
How do you create a seamless waterfall flow of elements in a responsive design?