CSS Mastery Challenge: Tough Interview Questions for Advanced Frontend Developers Quiz

  1. CSS vs. CSS3 Features

    Which of the following features was first introduced in CSS3 and was not available in earlier versions of CSS? For example, adding dynamic visual effects without JavaScript.

    1. A. Media Queries
    2. B. Margin Collapsing
    3. C. Font-Family Declaration
    4. D. Float Layouts
    5. E. Box Model
  2. Understanding Specificity Hierarchy

    Given the selectors #box, .highlight, and div, which one will have the highest specificity when applied to a u003Cdiv id='box' class='highlight'u003Eelementu003C/divu003E?

    1. A. div
    2. B. #box
    3. C. .highlight
    4. D. #highlight
    5. E. div .highlight
  3. Positioning Context Clarification

    With 'position: absolute;', an element is positioned relative to which of the following by default, when no ancestor has a positioning context?

    1. A. The nearest parent element
    2. B. The browser window
    3. C. The HTML root element
    4. D. The body element
    5. E. The next sibling element
  4. Deep Dive Into the Box Model

    In the CSS box model, which layer is directly between an element's content and its border? For example, if you set padding on an element, where does it appear?

    1. A. Margin
    2. B. Border
    3. C. Padding
    4. D. Outline
    5. E. Content Edge
  5. Relative Units in Practice

    If a parent div has a font-size of 20px, an inner span with font-size: 2em will have what computed font size?

    1. A. 10px
    2. B. 20em
    3. C. 40px
    4. D. 22px
    5. E. 2px
  6. Advanced Flexbox Properties

    In Flexbox, which property would you use to control the direction of flexible items, for example, swapping between row and column layouts?

    1. A. flex-wrap
    2. B. flex-grow
    3. C. flex-direction
    4. D. align-content
    5. E. display-flow
  7. Identifying Media Query Syntax

    Which of the following is a valid CSS media query to target screens smaller than 600px wide?

    1. A. @media (screen-width u003C 600px) { ... }
    2. B. @media screen and (min-width: 600px) { ... }
    3. C. @media only screen and (max-width: 600px) { ... }
    4. D. @media max-width=600px { ... }
    5. E. @media [widthu003C=600] { ... }
  8. Attribute Selectors Nuance

    Which CSS selector targets all input elements of type 'password', for example, to show an eye icon in password fields?

    1. A. input.password
    2. B. #password
    3. C. [input='password']
    4. D. input[type='password']
    5. E. .input[type=password]
  9. Distinguishing Pseudo-Elements and Pseudo-Classes

    Which of the following is a pseudo-class rather than a pseudo-element? For instance, it applies style based on user interaction.

    1. A. ::before
    2. B. ::marker
    3. C. :hover
    4. D. ::after
    5. E. ::first-letter
  10. Responsive Design Approach

    Which combination of techniques is essential for creating a responsive website that adapts to various screens and devices?

    1. A. Using fixed pixel widths and floats
    2. B. Relying solely on tables and absolute positioning
    3. C. Implementing media queries and flexible grid layouts
    4. D. Using only em units for font sizing
    5. E. Applying inline styles