HomeSubjectsUniversityBlogAbout

Advanced CSS & Responsive Design

Topic in Web Development

210 total MCQsShowing 30 with explanations10 Easy10 Medium10 Hard

About This Topic

Responsive design is the practice of building layouts that adapt to any screen size, mainly using flexible grids, media queries and modern CSS layout modules. Flexbox questions test justify-content, align-items, align-content, flex-grow, flex-shrink and flex-basis. CSS Grid items cover grid-template-columns, the fr unit, gap, grid areas and auto-fit versus auto-fill with minmax(). You should know mobile-first media queries, the viewport meta tag, fluid typography with clamp(), transitions versus keyframe animations, and transforms. Newer material includes custom properties (CSS variables), container queries, preprocessors like Sass, CSS-in-JS, utility-first frameworks such as Tailwind, and CSS Houdini.

Below are 30 practice questions from a pool of 210 Advanced CSS & Responsive Design MCQs, one of 17 topics in Web Development. Each shows the correct answer with an explanation; when you are ready, take a timed quiz to test recall under exam conditions.

Practice Questions

Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.

Advanced CSS & Responsive DesignEasy

Q1. What is CSS Flexbox?

  1. A.A JavaScript library for DOM element manipulation
  2. B.A CSS keyframe animation type for effects
  3. C.A third-party CSS framework for styling pages
  4. D.A layout model for one-dimensional rows or columns✓ Correct

Explanation

Flexbox distributes space among items in a container along a single axis.

Report an error in this question

Advanced CSS & Responsive DesignEasy

Q2. Which CSS property creates a flex container?

  1. A.display: flex✓ Correct
  2. B.flex: true
  3. C.layout: flex
  4. D.container: flex

Explanation

Setting display: flex makes an element a flex container.

Report an error in this question

Advanced CSS & Responsive DesignEasy

Q3. What is CSS Grid?

  1. A.A JavaScript grid plugin for data tables
  2. B.A third-party CSS component library
  3. C.A replacement exclusively for HTML tables
  4. D.A two-dimensional layout for rows and columns✓ Correct

Explanation

CSS Grid is a two-dimensional layout system for rows and columns simultaneously.

Report an error in this question

Advanced CSS & Responsive DesignEasy

Q4. Which property defines grid columns?

  1. A.column-template
  2. B.grid-template-columns✓ Correct
  3. C.display-columns
  4. D.grid-columns

Explanation

grid-template-columns defines the number and size of columns in a Grid container.

Report an error in this question

Advanced CSS & Responsive DesignEasy

Q5. What is a media query in CSS?

  1. A.A query for fetching database records
  2. B.A technique applying styles based on device traits✓ Correct
  3. C.An HTML element for embedding external content
  4. D.A JavaScript API for browser feature detection

Explanation

Media queries apply CSS rules conditionally based on device features.

Report an error in this question

Advanced CSS & Responsive DesignEasy

Q6. Which property controls the direction of flex items?

  1. A.flex-align
  2. B.flex-direction✓ Correct
  3. C.flex-orient
  4. D.flex-flow

Explanation

flex-direction sets whether flex items are arranged in a row or column.

Report an error in this question

Advanced CSS & Responsive DesignEasy

Q7. What does justify-content do in Flexbox?

  1. A.Distributes space between items along main axis✓ Correct
  2. B.Sets the font family for text inside items
  3. C.Aligns items along the cross axis vertically
  4. D.Changes the text alignment within flex items

Explanation

justify-content controls how flex items are distributed along the main axis.

Report an error in this question

Advanced CSS & Responsive DesignEasy

Q8. What is a CSS transition?

  1. A.A JavaScript event triggered by user action
  2. B.A smooth change between CSS property values✓ Correct
  3. C.An HTML animation tag for visual effects
  4. D.A page redirect to a new URL location

Explanation

CSS transitions allow property changes to occur smoothly over a specified duration.

Report an error in this question

Advanced CSS & Responsive DesignEasy

Q9. Which property creates a CSS animation?

  1. A.transition
  2. B.animation✓ Correct
  3. C.motion
  4. D.animate

Explanation

The animation property with @keyframes applies an animation to an element.

Report an error in this question

Advanced CSS & Responsive DesignEasy

Q10. What does align-items do in Flexbox?

  1. A.Sets item width
  2. B.Aligns items along the main axis
  3. C.Aligns items along the cross axis✓ Correct
  4. D.Changes item order

Explanation

align-items controls how flex items are aligned along the cross axis.

Report an error in this question

Advanced CSS & Responsive DesignMedium

Q11. What is the difference between Flexbox and Grid?

  1. A.They behave identically in all layout situations
  2. B.Flexbox was introduced after Grid in the spec
  3. C.Flexbox is one-dimensional, Grid is two-dimensional✓ Correct
  4. D.Grid is designed exclusively for table layouts

Explanation

Flexbox handles one dimension at a time, while Grid handles two dimensions simultaneously.

Report an error in this question

Advanced CSS & Responsive DesignMedium

Q12. What does grid-template-areas do?

  1. A.Creates content for individual grid items
  2. B.Defines named grid areas for placing items✓ Correct
  3. C.Creates decorative borders around grid cells
  4. D.Sets the color scheme for the grid layout

Explanation

grid-template-areas lets you name regions of the grid for intuitive layout design.

Report an error in this question

Advanced CSS & Responsive DesignMedium

Q13. What is a CSS pseudo-element?

  1. A.An HTML5 semantic element like header or footer
  2. B.A fake HTML element added via JavaScript
  3. C.A keyword styling a specific part of an element✓ Correct
  4. D.A JavaScript component for building interfaces

Explanation

Pseudo-elements like ::before and ::after style specific parts of an element.

Report an error in this question

Advanced CSS & Responsive DesignMedium

Q14. What is the fr unit in CSS Grid?

  1. A.A frequency measurement unit for media queries
  2. B.A font ratio measurement unit for sizing
  3. C.A fraction of available space in the container✓ Correct
  4. D.A frame rate measurement unit for animations

Explanation

The fr unit represents a share of the available space in a grid container.

Report an error in this question

Advanced CSS & Responsive DesignMedium

Q15. How do you create a responsive breakpoint for tablets?

  1. A.@responsive (tablet)
  2. B.@tablet { max-width }
  3. C.@breakpoint (tablet)
  4. D.@media (max-width: 768px)✓ Correct

Explanation

@media (max-width: 768px) is a common media query breakpoint for tablets.

Report an error in this question

Advanced CSS & Responsive DesignMedium

Q16. What does flex-wrap: wrap do?

  1. A.Creates a decorative border around all items
  2. B.Prevents items from wrapping to new lines
  3. C.Wraps the text content within each flex item
  4. D.Allows flex items to wrap onto multiple lines✓ Correct

Explanation

flex-wrap: wrap allows flex items to flow onto the next line.

Report an error in this question

Advanced CSS & Responsive DesignMedium

Q17. What is the gap property in CSS Grid?

  1. A.A gap in browser support for older versions
  2. B.A grid rendering error in certain browsers
  3. C.Sets the spacing between grid rows and columns✓ Correct
  4. D.The outer margin space around the entire grid

Explanation

The gap property sets the spacing between grid rows and columns.

Report an error in this question

Advanced CSS & Responsive DesignMedium

Q18. What does @keyframes define in CSS?

  1. A.Key events handled in JavaScript listeners
  2. B.The stages of a CSS animation sequence✓ Correct
  3. C.Keyboard shortcut bindings for the browser
  4. D.Database primary and foreign key definitions

Explanation

@keyframes defines the intermediate steps in a CSS animation.

Report an error in this question

Advanced CSS & Responsive DesignMedium

Q19. What is the object-fit CSS property?

  1. A.A flexbox property for controlling item alignment
  2. B.Specifies how an image resizes to fit its container✓ Correct
  3. C.A grid alignment property for placing grid items
  4. D.Fits text content into its parent containers

Explanation

object-fit controls how replaced content is resized to fit its container.

Report an error in this question

Advanced CSS & Responsive DesignMedium

Q20. What is a mobile-first design approach?

  1. A.Using only mobile-specific CSS frameworks
  2. B.Designing websites for desktop screens first
  3. C.Designing for small screens first then enhancing✓ Correct
  4. D.Designing websites for mobile devices only

Explanation

Mobile-first starts with styles for small screens and uses min-width media queries for larger screens.

Report an error in this question

Advanced CSS & Responsive DesignHard

Q21. What is CSS Subgrid?

  1. A.A third-party CSS grid component library
  2. B.A sub-layout variation of the Flexbox model
  3. C.A Grid feature letting nested grids adopt parent tracks✓ Correct
  4. D.A standalone CSS framework for page layouts

Explanation

Subgrid allows a nested grid to inherit row or column tracks from its parent grid.

Report an error in this question

Advanced CSS & Responsive DesignHard

Q22. What is the CSS aspect-ratio property?

  1. A.A media query feature for responsive design
  2. B.The ratio of CSS file sizes in a project
  3. C.A JavaScript API for measuring dimensions
  4. D.Sets a preferred aspect ratio for an element✓ Correct

Explanation

aspect-ratio sets the preferred width-to-height ratio for an element.

Report an error in this question

Advanced CSS & Responsive DesignHard

Q23. What is CSS Container Queries?

  1. A.Docker container related CSS configuration
  2. B.Media queries designed for flex containers
  3. C.Queries about the size of CSS containers
  4. D.Rules applying styles based on container size✓ Correct

Explanation

Container Queries allow components to adapt styles based on their container's size.

Report an error in this question

Advanced CSS & Responsive DesignHard

Q24. What is the CSS isolation property?

  1. A.Removes an element completely from the DOM tree
  2. B.Creates a new stacking context for the element✓ Correct
  3. C.Isolates an element from the internet connection
  4. D.Blocks all external CSS from affecting the element

Explanation

The isolation property forces an element to create a new stacking context.

Report an error in this question

Advanced CSS & Responsive DesignHard

Q25. What is the difference between transform and position for moving elements?

  1. A.transform skips layout recalculation; position triggers it✓ Correct
  2. B.transform only works within CSS Grid containers
  3. C.position is faster for rendering than transform
  4. D.They produce the same visual result always

Explanation

transform moves elements on the GPU without triggering layout reflow.

Report an error in this question

Advanced CSS & Responsive DesignHard

Q26. What are CSS Logical Properties?

  1. A.Properties with conditional logic based on breakpoints
  2. B.Properties that adapt to writing direction like inline-start✓ Correct
  3. C.Boolean CSS properties that toggle features on or off
  4. D.Properties that use logic gates for conditional values

Explanation

Logical Properties replace physical properties to support different writing modes.

Report an error in this question

Advanced CSS & Responsive DesignHard

Q27. What is the prefers-reduced-motion media query?

  1. A.A query detecting slow network connection speeds
  2. B.A query specifically targeting mobile touch devices
  3. C.A query detecting if user prefers less animation✓ Correct
  4. D.A query for applying print-specific style rules

Explanation

prefers-reduced-motion detects if a user has enabled reduced motion in their OS settings.

Report an error in this question

Advanced CSS & Responsive DesignHard

Q28. What is CSS Houdini?

  1. A.A popular CSS framework for responsive layouts
  2. B.Low-level APIs giving access to the CSS engine✓ Correct
  3. C.A browser debugging tool for inspecting CSS
  4. D.A magic trick animation library for CSS effects

Explanation

CSS Houdini provides APIs that let developers extend CSS by hooking into the rendering pipeline.

Report an error in this question

Advanced CSS & Responsive DesignHard

Q29. What is the content-visibility CSS property?

  1. A.Enables browser to skip rendering off-screen elements✓ Correct
  2. B.Controls how text content is displayed on screen
  3. C.An alternative to z-index for controlling layer order
  4. D.A toggle switching element visibility on and off

Explanation

content-visibility: auto lets the browser skip rendering off-screen elements.

Report an error in this question

Advanced CSS & Responsive DesignHard

Q30. How does the CSS cascade layer (@layer) work?

  1. A.It creates z-index layers for positioned elements
  2. B.It layers multiple background images on a single element
  3. C.It creates visible visual layers stacked on the page
  4. D.It defines explicit layers giving control over precedence✓ Correct

Explanation

@layer creates cascade layers that provide explicit control over style precedence.

Report an error in this question

Ready to test yourself on Advanced CSS & Responsive Design?

Take a timed quiz drawn from 210+ questions on this topic. No signup required — your progress saves in your browser.

Start Advanced CSS & Responsive Design Quiz