HTML & CSS Interview Questions
Box model, Flexbox, Grid, specificity, positioning, semantic HTML, responsive design and accessibility.
61 questions
Popular Searches
1. What is the CSS box model and how do content, padding, border, and margin interact?
easyLayout 6 mins2. What is the difference between the CSS box-sizing values content-box and border-box?
mediumLayout 6 mins3. How does CSS specificity work and how are conflicting rules resolved?
mediumCascade 7 mins4. What is the difference between Flexbox and CSS Grid, and when should you use each?
mediumLayout 6 mins5. What are semantic HTML elements and why do they matter for accessibility and SEO?
easyHTML Fundamentals 6 mins6. What is the difference between position relative, absolute, fixed, and sticky in CSS?
mediumPositioning 7 mins7. How does the CSS cascade and inheritance determine which styles apply?
mediumCSS Fundamentals 6 mins8. What is the difference between display block, inline, and inline-block?
easyCSS Layout 5 mins9. What are CSS media queries and how do they enable responsive design?
mediumResponsive Design 6 mins10. What is the difference between em, rem, px, and percentage units in CSS?
easyCSS Units 6 mins11. How do CSS pseudo-classes and pseudo-elements differ?
mediumSelectors 6 mins12. What is a stacking context and how does z-index actually work?
hardLayout 7 mins13. What is the difference between visibility hidden, display none, and opacity zero?
easyCSS Box Model & Rendering 6 mins14. How do CSS transitions and animations differ, and when do you use each?
mediumAnimation 7 mins15. What are CSS custom properties (variables) and how do they differ from preprocessor variables?
mediumCSS Architecture 7 mins16. What is the difference between the HTML id and class attributes?
easyHTML Attributes 6 mins17. How does the browser critical rendering path turn HTML and CSS into pixels?
mediumBrowser Rendering 8 mins18. What are ARIA roles and attributes and when should you use them?
mediumAccessibility 8 mins19. What is the difference between HTML data attributes and other ways to store metadata?
easyHTML Attributes 5 mins20. How do you center an element horizontally and vertically in CSS?
easyLayout 5 mins21. What is the difference between min-width, max-width, and width in responsive layouts?
mediumResponsive Design 6 mins22. What are CSS Grid template areas and how do they simplify layout?
mediumCSS Grid 6 mins23. What is the difference between absolute and relative URLs in HTML links and assets?
easyHTML Links 5 mins24. How does the picture element and srcset enable responsive images?
mediumResponsive Images 7 mins25. What is the difference between the meta viewport tag settings for mobile rendering?
mediumResponsive Design 6 mins26. How do CSS containment and content-visibility improve rendering performance?
hardPerformance 7 mins27. What is the difference between rem-based and clamp-based fluid typography?
mediumTypography 6 mins28. What are the differences between HTML form input types and their validation attributes?
mediumForms 7 mins29. How does the CSS overflow property control scrolling and clipping?
mediumLayout 7 mins30. What is the difference between logical properties (inline/block) and physical properties in CSS?
mediumLayout 7 mins31. Block vs Inline Elements: What's the Difference?
easyBox Model & Layout 5 mins32. What is Flexbox in CSS?
easyLayout 5 mins33. ID vs Class Selectors in CSS: What's the Difference?
easySelectors & Specificity 5 mins34. What is Specificity in CSS?
easySelectors & Specificity 5 mins35. What is the Position Property in CSS?
easyLayout 6 mins36. Relative vs Absolute Positioning in CSS
easyLayout 5 mins37. What is the Difference Between Padding and Margin?
mediumBox Model & Layout 6 mins38. What is a CSS Variable (Custom Property)?
mediumModern CSS 6 mins39. What is the Display Property in CSS?
mediumBox Model & Layout 6 mins40. What Is box-sizing in CSS and How Does It Affect Layout?
mediumCSS Layout 5 mins41. What Is a Viewport in Responsive Web Design?
mediumResponsive Design 5 mins42. What Is the Difference Between em and rem in CSS?
hardCSS Units 6 mins43. What Is a CSS Reset and Why Do Projects Use One?
hardCSS Fundamentals 6 mins44. What Is the Difference Between visibility and display in CSS?
hardCSS Layout 6 mins45. What Is a CSS Sprite and Why Was It Used?
hardCSS Images 5 mins46. What Is BEM Naming Convention in CSS?
hardCSS Architecture 6 mins47. What Is a Web Font and How Does @font-face Work?
hardCSS Typography 6 mins48. What Is Accessibility in HTML and Why Does It Matter?
hardWeb Accessibility 6 mins49. Why Does position: fixed Stop Working Inside a Transformed Ancestor?
hardCSS Layout 8 mins50. A Dropdown Renders Behind a Sibling Despite a Huge z-index. How Do You Debug It?
hardCSS Layout 8 mins51. How Do CSS Cascade Layers Change Specificity, and How Do You Debug a Rule That Loses?
hardCSS Architecture 9 mins52. When Would You Reach for Container Queries Instead of Media Queries?
mediumResponsive Design 9 mins53. What Problem Does CSS Subgrid Solve That a Nested Grid Cannot?
hardCSS Layout 9 mins54. Explain min-content, max-content, fit-content and fr — When Does Each Win?
hardCSS Layout 9 mins55. How Do CSS Custom Properties Inherit, and What Does @property Change?
hardCSS Architecture 9 mins56. What Triggers Reflow Versus Repaint, and What Is Layout Thrashing?
hardRendering Performance 9 mins57. Why Does a Child's Margin Push Its Parent Down, and How Do You Stop It?
mediumCSS Layout 8 mins58. How Do You Manage Focus and Accessible Names in a Custom Dialog?
hardAccessibility 9 mins59. How Does Native HTML Constraint Validation Work, and When Would You Override It?
mediumHTML Forms 10 mins60. Which Image Attributes Actually Affect LCP and Layout Shift?
mediumPerformance 9 mins61. How Do You Support prefers-reduced-motion, forced-colors and Print Styles?
mediumAccessibility 10 mins