Skip to content
tezvyn:

Top 30 Easy CSS & Design Systems Concepts Quiz for Beginners

30 easy multiple-choice CSS & Design Systems concept questions, the vocabulary and first principles, the parts you need before anything else makes sense. They come from 30 bites in the CSS & Design Systems library, the gentlest slice of the 169 CSS & Design Systems concept questions in the library. Answer them here or read straight down. Every question carries the correct option, why it is correct, and a link to the bite it came from.

Tailwind, CSS, accessibility, design tokens

30 questions. Pick an answer, or open “Show the answer” to read it.

Answers are graded in your browser. Nothing is saved, and no XP or streak is earned here. The app keeps score.

  1. Question 1 of 30

    Which sequence correctly describes the CSS Cascade's tie-breaking process for style conflicts?

    Show the answer

    Answer: c · Origin and Importance, then Specificity, then Source Order

    The cascade first considers the rule's origin and importance (e.g., !important declarations). If still a tie, it then compares the specificity of the selectors. Finally, if all else is equal, the rule defined later in the code (source order) wins.

    Read the full bite: CSS Cascade: How Browsers Resolve Style Conflicts

  2. Question 2 of 30

    An HTML div element has id="main" and class="active". Which CSS rule will apply its color?

    Show the answer

    Answer: c · div#main { color: red; }

    The rule div#main has a specificity score of 1-0-1 (one ID, one type selector), which is higher than #main (1-0-0), .active (0-1-0), and div.active (0-1-1) when comparing the scores from left to right. The ID column takes precedence over the class and type columns.

    Read the full bite: CSS Specificity: The Browser's Tie-Breaking Rule

  3. Question 3 of 30

    An element has width: 200px, padding: 20px, and border: 5px. What is its final rendered width with box-sizing: content-box?

    Show the answer

    Answer: d · 250px

    With box-sizing: content-box, the specified width (200px) applies only to the content area. The padding (20px on each side) and border (5px on each side) are then added outside this content, resulting in a total width of 200 + (2*20) + (2*5) = 250px. Option A (200px) would be the result if box-sizing: border-box were used.

    Read the full bite: CSS Box Model: Every Element is a Box

  4. Question 4 of 30

    Why do properties like width, margin, and padding typically not inherit in CSS?

    Show the answer

    Answer: a · Because inheriting them would often lead to broken layouts and unusable pages.

    The card explicitly states that properties like width, height, padding, margin, and border do not inherit because it would usually be undesirable, leading to unusable pages. The other options present plausible but incorrect reasons not mentioned in the card.

    Read the full bite: CSS Inheritance: Styles Flow Downhill

  5. Question 5 of 30

    According to the card, what is a key reason to prefer class selectors over ID selectors when styling reusable UI components?

    Show the answer

    Answer: a · Class selectors have lower specificity, making their styles easier to override and promoting reusability.

    The card explicitly states that ID selectors' "high specificity makes them difficult to override and reduces reusability," while recommending class selectors for "reusable components." Option C is true but does not explain the core reason for preference in terms of styling management.

    Read the full bite: CSS Selectors: How to Target HTML for Styling

  6. Question 6 of 30

    Which scenario best highlights the primary advantage of using HSL color values in CSS?

    Show the answer

    Answer: a · When programmatically adjusting color properties like lightness for hover states.

    HSL (Hue, Saturation, Lightness) is ideal for programmatic color manipulation, allowing developers to easily create variations like lighter or darker shades. The other options describe the primary use cases for keywords, hexadecimal values, and RGB values, respectively.

    Read the full bite: CSS Color Values: From Keywords to Functions

  7. Question 7 of 30

    In which scenario would using the CSS font shorthand property be ill-advised?

    Show the answer

    Answer: a · When you only want to modify font-weight without affecting other inherited font styles.

    The card explicitly states to avoid using the font shorthand when only changing a single property, as it would reset other inherited font styles to their initial values. Options A and C describe recommended use cases for the shorthand, while option D describes its primary function, not a reason to avoid it.

    Read the full bite: CSS `font`: The All-in-One Typography Shorthand

  8. Question 8 of 30

    When should you generally avoid using the CSS `background` shorthand property?

    Show the answer

    Answer: b · When you only intend to modify one specific background property of an already styled element.

    The `background` shorthand resets all unspecified background properties to their default values. Therefore, using it to change only one property on an existing background will inadvertently remove or reset other previously set properties. Options A, B, and D describe scenarios where the shorthand is efficient and recommended.

    Read the full bite: CSS `background`: The All-in-One Shorthand

  9. Question 9 of 30

    Given the CSS declaration border-radius: 10px 20px;, which corners will receive a 20px radius?

    Show the answer

    Answer: d · Top-right and bottom-left

    The card states that with two values, the first value applies to the top-left and bottom-right corners, while the second value applies to the top-right and bottom-left corners. Therefore, 20px will be applied to the top-right and bottom-left corners. Option B describes the application of the 10px value.

    Read the full bite: border-radius: More Than Just Rounded Corners

  10. Question 10 of 30

    When a Flexbox container has flex-direction: column, which statement correctly describes its main and cross axes?

    Show the answer

    Answer: d · The main axis is vertical, and the cross axis is horizontal.

    The card states that flex-direction sets the main axis, and if flex-direction is column, the main axis becomes vertical, with the cross axis automatically perpendicular, hence horizontal. Option B describes the axis orientation for flex-direction: row, which is a common point of confusion.

    Read the full bite: CSS Flexbox: Mastering the Main and Cross Axis

  11. Question 11 of 30

    For which layout scenario is CSS Grid most appropriately used?

    Show the answer

    Answer: c · Designing a page's main structure with a header, sidebar, and content area.

    The card states that CSS Grid is ideal for the "overall layout of a page, such as creating a classic layout with a header, footer, main content, and sidebars," which aligns with option C. Options A and D describe one-dimensional layouts, for which Flexbox is generally more suitable, and option D is explicitly stated as not being a use case for Grid.

    Read the full bite: CSS Grid: Defining a 2D Layout Container

  12. Question 12 of 30

    To achieve consistent spacing only between items within a Flexbox container, without adding space to the container's outer edges, which CSS property should be applied to the container?

    Show the answer

    Answer: a · gap on the container

    The 'gap' property is designed to add space exclusively between layout items, not around them or on the container's edges. Using 'margin' on child elements with complex selectors was the 'hack' that 'gap' was created to replace, and 'padding' adds space around the container's content, not just between siblings.

    Read the full bite: The `gap` Property: Spacing Without Margin Hacks

  13. Question 13 of 30

    What is the primary purpose of the @media rule in CSS?

    Show the answer

    Answer: d · To define styles that adapt to different device characteristics, such as screen dimensions or orientation.

    The @media rule is described as "conditional logic for your styles" that asks questions about the "device viewing your page," such as screen width, to apply styles. Option C describes container queries, which the card explicitly states are for when not to use @media.

    Read the full bite: The @media Rule: CSS for Different Screens

  14. Question 14 of 30

    What primary problem did the viewport meta tag solve for early mobile browsers?

    Show the answer

    Answer: c · It prevented mobile browsers from automatically scaling down desktop-sized pages, making text unreadable.

    The card explains that early mobile browsers would render pages at a default desktop width and then shrink them, leading to unreadably tiny text. The viewport meta tag was created to override this behavior by setting the page width to the device's width. Disabling user zoom (option B) is explicitly mentioned as a critical accessibility failure and misuse, not the primary problem the tag solves.

    Read the full bite: The Viewport Meta Tag: Your First Responsive Step

  15. Question 15 of 30

    What is a potential drawback of implementing a purely fluid layout without additional constraints?

    Show the answer

    Answer: b · Content might become unreadably wide or awkwardly cramped at extreme screen sizes.

    The card states that purely fluid layouts can lead to unreadably long text lines on very wide screens or squished columns on very narrow screens. Options A and B describe problems that fluid layouts are designed to prevent, not cause.

    Read the full bite: Fluid Layouts: Adapting Content to Any Screen

  16. Question 16 of 30

    What is the main advantage of using srcset or picture for images, compared to relying solely on max-width: 100%?

    Show the answer

    Answer: a · It allows the browser to select the most appropriate image file for the user's device, optimizing bandwidth and visual quality.

    The card emphasizes that srcset and picture provide the browser with a menu of image options, allowing it to choose the best one for the user's device to save bandwidth and improve display quality. Option D is incorrect because these techniques require providing multiple image files, not reducing them.

    Read the full bite: Flexible Images: More Than Just `max-width`

  17. Question 17 of 30

    Which scenario best illustrates an appropriate use case for CSS transitions?

    Show the answer

    Answer: a · Smoothly fading a button's background color when a user hovers over it.

    CSS transitions are designed for smoothly animating simple property changes, such as a button's background color on hover, as described in the card's canonical example. Complex, multi-stage animations are better handled by CSS Animations (@keyframes), and transitions are not for instant changes or page load optimization.

    Read the full bite: CSS Transitions: Animating State Changes

  18. Question 18 of 30

    What is a fundamental characteristic of CSS 2D transforms regarding an element's position and surrounding content?

    Show the answer

    Answer: b · They visually alter an element's appearance (e.g., position, size) but do not change its occupied space in the document flow.

    CSS 2D transforms visually manipulate an element without affecting its original space in the document flow, meaning surrounding elements are not re-laid out. Option C is incorrect because transforms specifically avoid triggering costly re-layouts and do not cause surrounding elements to reflow.

    Read the full bite: CSS 2D Transforms: Move, Rotate, and Scale Elements

  19. Question 19 of 30

    For which purpose is pointer-events: none most appropriately used on a CSS overlay?

    Show the answer

    Answer: d · To prevent the overlay from receiving pointer events, allowing interaction with elements beneath it.

    The correct answer (D) describes the core function of pointer-events: none, which is to make an element a 'ghost' for pointer interactions. Option C is incorrect because this property only affects pointer events, not keyboard navigation or accessibility tools, and children can override it.

    Read the full bite: pointer-events: Making Elements Click-Through

  20. Question 20 of 30

    What is the primary benefit of applying the OOCSS principle of separating "structure" from "skin"?

    Show the answer

    Answer: b · It allows developers to create reusable decorative styles that can be combined with various layout definitions.

    The card explains that "Skin" refers to reusable decorative styles (like colors, borders) and "Structure" to layout properties (like width, height). Separating them allows you to apply a single reusable skin class to different elements that might have distinct structural classes, promoting modularity and reducing duplication. Option C, while related to consistency, is not the direct benefit of this specific separation, which focuses on reusability rather than cross-browser compatibility.

    Read the full bite: OOCSS: Reusable Styles for Maintainable CSS

  21. Question 21 of 30

    Which scenario demonstrates an incorrect application of CSS Custom Properties?

    Show the answer

    Answer: a · Attempting to set a CSS property name like var(--display-type): block;.

    The card explicitly states that custom properties can only hold property values and cannot be used for property names. Therefore, using a variable to define the property itself, such as var(--display-type): block;, is an incorrect application. The other options describe valid and common uses for custom properties.

    Read the full bite: CSS Custom Properties: Variables for Your Stylesheet

  22. Question 22 of 30

    Which characteristic is central to how utility-first CSS achieves faster and safer styling?

    Show the answer

    Answer: d · It co-locates single-purpose styling classes directly within the HTML markup.

    The card states that utility-first CSS makes styling faster and safer by "co-locating styles with the markup they apply to, reducing context switching and eliminating side effects." This is achieved by applying single-purpose classes directly in the HTML. Option A is incorrect because utility-first CSS uses a predefined set of utility classes, not automatically generated semantic names.

    Read the full bite: Utility-First CSS: Style Directly in Your Markup

  23. Question 23 of 30

    Which statement accurately describes a fundamental characteristic of Sass variables?

    Show the answer

    Answer: d · Their values are processed and replaced with static CSS values before the browser renders the page.

    Sass variables are compile-time constants, meaning their values are resolved during compilation and replaced with static CSS in the final output. Options A and C describe the behavior of native CSS custom properties, which are dynamic and can be manipulated in the browser, a key distinction highlighted in the card.

    Read the full bite: Sass Variables: Compile-Time Constants for CSS

  24. Question 24 of 30

    What is the primary drawback of over-nesting in Sass?

    Show the answer

    Answer: a · It leads to highly specific CSS selectors that are difficult to manage and override.

    The card explicitly states that "The footgun is over-nesting, which creates bloated, overly-specific CSS" and that "Each level of nesting increases selector specificity, making styles harder to override later." Option C is incorrect because while deep nesting can bloat the final CSS file, the primary drawback highlighted is the specificity and management of the resulting CSS, not necessarily the compilation time itself.

    Read the full bite: Sass Nesting: Write CSS That Mirrors Your HTML

  25. Question 25 of 30

    When is CSS minification primarily recommended in a web development project?

    Show the answer

    Answer: b · As an automated step when preparing the website for deployment to a production server.

    The card states that minification should be a standard step for deployment to a production environment to improve performance. It explicitly advises against minifying code during development because readable code is essential for debugging and collaboration.

    Read the full bite: CSS Minification: Smaller Files, Faster Sites

  26. Question 26 of 30

    What primary problem does Autoprefixer solve for front-end developers?

    Show the answer

    Answer: b · Automatically adding necessary vendor prefixes to modern CSS properties.

    Autoprefixer's core function is to automate the addition of vendor prefixes to modern CSS, as stated in the card's 'WHY IT EXISTS' and 'THE MENTAL MODEL' sections. Option D describes a different CSS optimization tool, not Autoprefixer.

    Read the full bite: Autoprefixer: Stop Memorizing CSS Vendor Prefixes

  27. Question 27 of 30

    What is the primary benefit a growing organization gains from implementing a design system?

    Show the answer

    Answer: b · It centralizes UI components and guidelines, ensuring a consistent user experience and improving development efficiency.

    The card states a design system acts as a "single source of truth" to ensure "a consistent look across apps" and is "crucial for improving efficiency" by preventing reinvention. Option C is incorrect because a design system aims for consistency and shared standards, not independent, unique styles.

    Read the full bite: Design Systems: Stop Reinventing UI Components

  28. Question 28 of 30

    Which of the following best describes the main advantage of implementing a component library for a large software product?

    Show the answer

    Answer: d · It ensures visual and functional consistency across the product while accelerating development.

    The card states that component libraries were created to manage complexity, ensure consistency, and speed up development across large applications. Option D directly captures these primary benefits. Option C is incorrect because while maintenance is centralized, the library itself requires ongoing effort and a dedicated team, not a reduction in overall maintenance needs.

    Read the full bite: Component Library: Your UI's LEGO Box

  29. Question 29 of 30

    What is the primary benefit of adopting the W3C Design Tokens standard for a UI project?

    Show the answer

    Answer: d · It establishes a single source of truth for UI style values, ensuring consistency across diverse platforms and tools.

    The card highlights that the standard acts as a "universal adapter" and "single source of truth" for style values, bridging design and development to ensure consistency across multiple platforms and tools. Option C is incorrect because it facilitates collaboration and consistent implementation, not the elimination of developer roles.

    Read the full bite: W3C Design Tokens: A Standard Format for UI Decisions

  30. Question 30 of 30

    Which type of Custom Element should be avoided for broad browser compatibility?

    Show the answer

    Answer: a · Customized built-in elements

    The card explicitly states that "Customized built-in elements... are not supported in Safari," making them unsuitable for broad compatibility. Autonomous elements, conversely, are recommended for cross-browser projects.

    Read the full bite: Custom Elements: Create Your Own HTML Tags

Could you explain these out loud?

That is what an interview actually tests. Tezvyn gives you questions like these with what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon