100 HTML & CSS interview questions and answers
HTML and CSS interview questions on semantics, accessibility, the box model, flexbox and grid, specificity, responsive design and modern CSS like :has() and container queries.
Easy69 easy HTML & CSS questions
- 1What is HTML?
- 2What is the structure of an HTML document?
- 3What is <!DOCTYPE html>?
- 4Difference between HTML4 and HTML5?
- 5What are semantic tags?
- 6Examples of semantic elements?
- 7What is <div> vs <span>?
- 8What is a block vs inline element?
- 9What is the <meta> tag?
- 10What is the viewport meta tag?
- 11What is <head> vs <body>?
- 12What is the <title> tag?
- 13What is the <link> tag?
- 14What is the <script> tag?
- 16What is the <img> tag?
- 17What is the alt attribute?
- 18What is the <a> tag?
- 19Difference: absolute vs relative URL?
- 20What is the <form> element?
- 21What are form elements?
- 22What are input types?
- 23What is the label tag?
- 24What is the placeholder attribute?
- 25What is the required attribute?
- 27What is the <table> structure?
- 31What is accessibility (a11y)?
- 33What is aria-label?
- 34What is SEO in HTML?
- 35What is a meta description?
- 36What is a favicon?
- 37What is a data-* attribute?
- 40What is lazy loading (loading='lazy')?
- 44What is the <video> tag?
- 45What is the <audio> tag?
- 46What is the <progress> tag?
- 47What is <details> and <summary>?
- 48What is <noscript>?
- 51What is CSS?
- 52Types of CSS (inline, internal, external)?
- 53What is a selector?
- 57What is the box model?
- 58Difference: margin vs padding?
- 59What is a border?
- 60What is the display property?
- 61Block vs inline vs inline-block?
- 62What is visibility vs display?
- 63What is overflow?
- 64What is position?
- 67What is float?
- 68What is clear?
- 69What is opacity?
- 70What are background properties?
- 71What are color formats?
- 72What are font properties?
- 73What is text-align?
- 74What is line-height?
- 75What is letter-spacing?
- 76What is Flexbox?
- 78What is justify-content?
- 79What is align-items?
- 83What is a media query?
- 84What are breakpoints?
- 85What is mobile-first design?
- 86What is responsive design?
- 87What are viewport units (vh, vw)?
- 89What is object-fit?
- 90What is aspect-ratio?
- 93What are variables in CSS?
- 99What is transition?
Medium31 medium HTML & CSS questions
- 15Difference: defer vs async?
- 26What is the pattern attribute?
- 28What is an <iframe>?
- 29What is <canvas>?
- 30What is <svg>?
- 32What is ARIA?
- 38What is contenteditable?
- 39What is draggable?
- 41What is the <picture> tag?
- 42What are responsive images?
- 43What is srcset?
- 49What is tabindex?
- 50What is the DOM?
- 54Types of selectors?
- 55What is specificity?
- 56What is !important?
- 65Position types?
- 66What is z-index?
- 77Main axis vs cross axis?
- 80flex-grow, flex-shrink, flex-basis?
- 81What is CSS Grid?
- 82Grid vs Flexbox?
- 88What is rem vs em?
- 91What are CSS preprocessors (SASS)?
- 92What is nesting in CSS?
- 94What are CSS custom properties?
- 95What is BEM methodology?
- 96What are CSS Modules?
- 97What is Tailwind CSS?
- 98What is animation in CSS?
- 100What is transform?