โ† All CSS Flashcard Decks

CSS Advanced Practice Flashcards

7 cards from real CSS practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 7 CSS Advanced Practice flashcards as text
  1. What does the CSS custom property fallback syntax var(--x, blue) mean?

    Answer: Use --x, or blue if --x is invalid or undefined

    The second argument is the fallback used when the custom property is not set or invalid.

  2. Which property defines how a flex item grows relative to siblings?

    Answer: flex-grow

    flex-grow sets the proportion of available space an item takes when growing.

  3. What does 'object-fit: cover' do to a replaced element like an image?

    Answer: Scales to fill the box preserving ratio, cropping overflow

    object-fit: cover fills the content box while preserving aspect ratio, cropping the excess.

  4. Which at-rule lets you apply styles based on a container's size rather than the viewport?

    Answer: @container

    @container queries style elements based on the size of their nearest container with containment.

  5. What does the ':is()' pseudo-class function provide?

    Answer: A way to match a list of selectors compactly, taking the highest specificity in the list

    :is() matches any selector in its list and takes the specificity of its most specific argument.

  6. Which transform function moves an element along the Z-axis in 3D space?

    Answer: translateZ()

    translateZ() shifts an element along the depth axis, useful with perspective.

  7. What is the effect of 'will-change: transform'?

    Answer: Hints the browser to optimize for upcoming transform changes

    will-change advises the browser to prepare optimizations for the named property before it changes.