What does the animation-fill-mode: forwards; property-value combination do?

  • Applies styles defined in the keyframes to the element before the animation starts
  • Holds the final keyframe styles after the animation finishes
  • Keeps the animation running indefinitely
  • Stops the animation as soon as it completes
The animation-fill-mode: forwards; property-value combination holds the final keyframe styles after the animation finishes. This means that after the animation completes, the element retains the styles from the final keyframe. This can be useful for maintaining a particular state after the animation finishes.

How does an element with position: sticky; behave when scrolling past its container?

  • It becomes transparent.
  • It disappears from the layout.
  • It remains fixed in its original position.
  • It scrolls with the container.
When an element has a 'position: sticky;' property and scrolls past its container, it sticks to the container until it reaches a specified offset, after which it scrolls along with the container. This behavior is often used for navigation bars.

What is the result when an element does not have a specific style defined but its parent does?

  • The browser applies default styles to the element.
  • The element inherits styles from a global stylesheet.
  • The element inherits the styles from its parent.
  • The element remains unstyled.
When an element does not have a specific style defined but its parent does, it will inherit the styles from its parent. This inheritance is a fundamental concept in CSS and helps maintain consistency in the appearance of web pages.

You want to target all paragraphs that are immediately after an h2 element within the same container. Which CSS selector combination will you use?

  • h2 + p
  • h2 > p
  • h2 p
  • h2 ~ p
To target all paragraphs immediately after an h2 element within the same container, you would use the selector h2 + p. This selector selects any

element that is immediately preceded by an

element.

How does Autoprefixing aid in ensuring cross-browser compatibility?

  • Autoprefixing adds vendor-specific prefixes to CSS properties, ensuring compatibility with various browsers.
  • Autoprefixing automatically generates alternate versions of your styles for different browsers.
  • Autoprefixing replaces outdated CSS properties with modern equivalents.
  • It converts JavaScript code to CSS for browsers that do not support modern JavaScript.
Autoprefixing is the process of adding vendor-specific prefixes to CSS properties to ensure cross-browser compatibility. It automatically generates CSS rules with the necessary prefixes, like -webkit-, -moz-, or -ms-, making sure that your styles are correctly interpreted by different browsers. This helps avoid the need for writing separate CSS rules for each browser.

If you want to vertically center an inline or inline-block element relative to its parent, you'd set "vertical-align" to ________.

  • baseline
  • center
  • middle
  • top
To vertically center an inline or inline-block element relative to its parent, you'd set the "vertical-align" property to middle. This property allows you to control the vertical alignment of inline-level elements within their line boxes.

What is SASS primarily used for in web development?

  • Styling web pages with JavaScript
  • Compiling code into machine language
  • Enhancing website security
  • Simplifying and organizing CSS
SASS (Syntactically Awesome Style Sheets) is primarily used in web development for simplifying and organizing CSS. It introduces features like variables, nesting, and mixins, making your CSS more maintainable and efficient.

The CSS function clamp() restricts a value between a specified ______ and ______.

  • left, right
  • lower, upper
  • minimum, maximum
  • start, end
The CSS clamp() function is used to restrict a value between a specified minimum and maximum value. It allows for responsive design by ensuring that the value falls within this range, helping to maintain a consistent layout across different screen sizes.

You're optimizing a website for better scroll performance. Which CSS property would you use to hint to the browser about an element that will change frequently?

  • position: fixed;
  • transform: translate3d(0,0,0);
  • will-change
  • z-index
To optimize scroll performance, you can use the will-change property to hint to the browser that an element will change frequently. This allows the browser to prepare for the changes and allocate resources accordingly, improving scrolling performance. While using transform: translate3d(0,0,0); can also trigger hardware acceleration, it may not be as specific or efficient as will-change. z-index and position: fixed; are unrelated to hinting to the browser about frequent changes in an element.

The BEM methodology suggests a naming convention where the block is separated from the element by a ________.

  • -
  • .
  • :
  • _
BEM (Block Element Modifier) methodology recommends using an underscore (_) to separate the block from the element in class names. This naming convention enhances code readability and helps identify the hierarchy of elements within a block. For instance, a button element inside a header block might be named header_button.