🎨
Top 52 HTML / CSS Interview Questions & Answers (2026)
52 Questions
21 Beginner
20 Intermediate
11 Advanced
About HTML / CSS
This technology is widely used in software development and is a frequent topic in technical interviews at companies of all sizes.
What to Expect in a HTML / CSS Interview
Interviews cover both foundational concepts and practical application of this technology, with questions ranging from definitions to architectural decision-making.
How to Use This Guide
Work through questions in order of difficulty to build your understanding progressively. Bookmark challenging questions and revisit them before your interview.
Curated by Tech Baithak Editorial Team · Last updated: May 2026
Beginner
21 questions
Core concepts every HTML / CSS developer must know.
01
What is HTML and what does it stand for?
02
What is the difference between HTML and HTML5?
03
What are semantic HTML elements? Give examples.
04
What is the DOCTYPE declaration and why is it needed?
05
What is the difference between <div> and <span>?
06
What is the CSS box model?
07
What is the difference between margin and padding in CSS?
08
What are CSS selectors? List the main types.
09
What is CSS specificity?
10
What is the CSS position property and what are its values?
11
What is Flexbox in CSS?
12
What is CSS Grid?
13
What are CSS media queries?
14
What is the difference between inline, block, and inline-block display values?
15
What is the CSS float property?
16
What are CSS pseudo-classes and pseudo-elements?
17
What is the CSS z-index property?
18
What is the CSS box-sizing property?
19
What is responsive web design?
20
What are HTML5 semantic elements and why are they important?
21
What is the difference between src and href HTML attributes?
Intermediate
20 questions
Practical knowledge for developers with hands-on experience.
01
How does the CSS cascade work?
02
What is BEM (Block Element Modifier) methodology in CSS?
03
What are CSS custom properties (CSS variables)?
04
What is the difference between em, rem, px, vh, and vw units in CSS?
05
How does Flexbox differ from CSS Grid? When would you use each?
06
What is the difference between CSS transitions and CSS animations?
07
What are HTML data attributes (data-*)?
08
What is ARIA and how does it improve web accessibility?
09
What is the difference between display:none, visibility:hidden, and opacity:0?
10
What are CSS preprocessors (Sass/Less) and what do they add?
11
What are srcset and sizes attributes for responsive images?
12
What is the CSS outline property and how does it differ from border?
13
What is the critical rendering path in browsers?
14
What are web fonts and how do you use @font-face?
15
What is CSS Grid's fr unit?
16
What is the CSS object-fit property?
17
What is the CSS transform property?
18
What are HTML meta tags and what are they used for?
19
What are CSS Logical Properties?
20
What is the :root pseudo-class in CSS and what is it used for?
Advanced
11 questions
Deep expertise questions for senior and lead roles.
01
What are CSS container queries and how do they differ from media queries?
02
What is the CSS @layer at-rule?
03
What is the Shadow DOM and what problem does it solve?
04
What are CSS Houdini APIs?
05
What is the difference between browser reflow and repaint?
06
What are CSS :is(), :where(), and :has() selectors?
07
What is CSS containment and the contain property?
08
What is the CSS aspect-ratio property?
09
What is CSS subgrid and how does it work?
10
What is the CSS will-change property and when should it be used?
11
What are Web Components and what standards make them up?
Back to All Topics
52 questions total