Which CSS property defines the number of times an animation should run?

  • animation-iteration
  • animation-iteration-count
  • animation-loop
  • animation-repeat
The CSS property that defines the number of times an animation should run is animation-iteration-count. By specifying a value, such as an integer or "infinite," you can control how many times the animation repeats. This property is essential for creating looping animations with a specific number of iterations or an indefinite loop.

You're designing a webpage where you want to ensure that the distance between lines of text is 1.5 times the size of the text. How would you achieve this using CSS?

  • line-height: 1.5em;
  • line-height: 1.5x;
  • line-height: 150%;
  • line-spacing: 1.5;
To ensure that the distance between lines of text is 1.5 times the size of the text, you can use the line-height property in CSS. You can set it to 150%, which is equivalent to 1.5 times the font size. Alternatively, you can use line-height with an em value, like 1.5em, which achieves the same effect.

The backface-visibility property in CSS is particularly useful when ________.

  • applying transitions
  • creating 3D transformations
  • creating responsive layouts
  • using media queries
The backface-visibility property in CSS is particularly useful when creating 3D transformations. When set to hidden, it prevents the back side of an element from being visible, which is essential for 3D transformations where the front and back of an element should not be visible simultaneously.

In Flexbox, which property is used to define how items are aligned along the main axis?

  • align-content
  • align-items
  • flex-direction
  • justify-content
In Flexbox, the justify-content property is used to define how items are aligned along the main axis. It controls the distribution of space between and around items along the main axis and is commonly used to center items horizontally or vertically.

The ________ combinator in CSS targets elements that are placed immediately after a specific element.

  • + (Adjacent Sibling)
  • , (Comma)
  • > (Child)
  • ~ (General Sibling)
The "+" (Adjacent Sibling) combinator in CSS targets elements that are placed immediately after a specific element. It selects elements that share the same parent and are placed directly after the specified element.

When using the "vertical-align" property, what does the value "baseline" represent?

  • Aligns elements to the baseline of the parent element
  • Aligns elements to the bottom of the line box
  • Aligns elements to the middle of the line box
  • Aligns elements to the top of the line box
In CSS, the "vertical-align" property is used to control the vertical alignment of inline or inline-block elements within a line box. When set to "baseline," it aligns elements to the baseline of their parent element, which is typically the bottom of the characters within the text.

To create a shadow effect behind an element, you'd use the ________ filter.

  • blur
  • drop-shadow
  • glow
  • shadow
To create a shadow effect behind an element in CSS, you'd use the drop-shadow filter. This filter adds a shadow to an element, allowing you to control its position, color, and blur.

Which display value would you use to hide an element but keep its space in the layout?

  • display: block;
  • display: hidden;
  • display: invisible;
  • display: none;
To hide an element but maintain its space in the layout, you would use 'display: none;'. This property effectively removes the element from the display, but it still occupies space, which can be useful for various purposes.

On a blog page, you want to emphasize the first line of every paragraph differently from the rest of the content. Which CSS property and pseudo-element will help you achieve this effect?

  • ::emphasize
  • ::first-letter
  • ::first-line
  • ::highlight
To emphasize the first line of every paragraph differently from the rest of the content, you should use the ::first-line pseudo-element in CSS. This pseudo-element targets the first line of a block-level element and allows you to apply specific styling to it.

You're working on a large-scale project and want to ensure your CSS remains maintainable as the project grows. Which modular CSS methodology would be most appropriate to consider?

  • BEM (Block Element Modifier)
  • OOCSS (Object-Oriented CSS)
  • SMACSS (Scalable and Modular Architecture for CSS)
  • Atomic CSS
When working on a large-scale project, the BEM (Block Element Modifier) methodology is highly appropriate. BEM encourages the creation of modular and reusable CSS code by structuring classes in a way that makes it easy to understand their purpose. It follows a strict naming convention, which helps maintainability as the project grows.