Frontend Fundamentals: HTML, CSS, and Responsive Styling Questions

Core web-platform implementation skills: semantic HTML and document structure, native controls versus ARIA-patched divs (button versus link), accessible markup (labels, headings, landmarks, image alt text, icon-only buttons, keyboard operability, skip links, ARIA basics, focus styles), the CSS box model, cascade and specificity (including cascade layers and taming !important), selector matching cost, display types, positioning (static, relative, absolute, fixed, sticky) and stacking contexts and z-index, flexbox and grid layout (including subgrid and masonry options), units and fluid sizing (rem, clamp, viewport units including dynamic viewport units), the viewport meta tag, media queries, mobile-first breakpoints and how to choose them, container queries, responsive images (srcset, sizes, picture, aspect-ratio), touch target sizing, right-to-left and long-text layouts, custom properties and light/dark theming, and CSS organization (BEM, CSS Modules, utility-first, Sass). Includes debugging layout bugs, progressive enhancement, @supports and cross-engine CSS fallbacks. Performance measurement, building full interactive widgets and form flows, design-system governance, WCAG audit strategy, design handoff, visual regression testing and cross-browser test coverage are covered elsewhere.

EasyTechnical
82 practiced

You have a horizontal navigation bar with an unordered list. The design requires items to be centered vertically and spaced evenly across the width; on narrow screens the items should wrap onto multiple lines. Given this HTML:

html
<nav class='nav'><ul class='nav__list'><li class='nav__item'>Home</li><li class='nav__item'>Products</li><li class='nav__item'>About</li></ul></nav>

Write the CSS (using Flexbox) to achieve the design and explain how to make wrapping work correctly.

EasyTechnical
91 practiced

Write plain CSS (no frameworks) for a responsive, mobile-first centered container. Requirements: container should be fluid on small screens, have width:100% up to a max-width of 1200px on large screens, be horizontally centered, include 16px side padding on small screens and 32px side padding on screens >= 768px. Provide the CSS rules only.

EasyTechnical
83 practiced

Implement a responsive card grid using a mobile-first approach. Requirements:

  • Mobile: single column
  • Tablet: two columns
  • Desktop: four columns
    Provide the CSS (you may use CSS Grid or Flexbox). Explain your chosen breakpoints and why mobile-first helps maintain performance and progressive enhancement.
MediumTechnical
74 practiced

You are reviewing a component library and find three recurring accessibility problems: clickable divs, icon-only buttons with no text, and focus that disappears when a panel opens. For each, show the markup fix and explain what a keyboard or screen-reader user experiences before and after.

EasyTechnical
67 practiced

When should you use a <button> element versus an <a href='...'> anchor or <input type='button'>? Discuss semantic intent, default keyboard and screen-reader behavior, focusability, and how incorrect choices can harm accessibility. Provide examples of correct and incorrect usage for navigation, actions, and form submission.

Unlock Full Question Bank

Get access to all 26 Frontend Fundamentals: HTML, CSS, and Responsive Styling interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.