In CSS, if you want an element to inherit a property's value from its parent element, you would use the value ________.

  • Copy
  • Inherit
  • Override
  • Override-all
To make an element inherit a property's value from its parent element, you would use the 'inherit' value. This ensures that the child element inherits the property value from its parent.

Styled Components utilize ________ to generate unique class names for styles.

  • BEM methodology
  • Hashing algorithms
  • Inline CSS
  • Random strings
Styled Components generate unique class names for styles by using hashing algorithms. This ensures that styles are isolated and don't interfere with other components, a technique often referred to as "CSS-in-JS" or "CSS Modules."

What does the CSS property "line-height" primarily affect?

  • Background color
  • Font color
  • Spacing between lines of text
  • Text size
The CSS property "line-height" primarily affects the spacing between lines of text within an element. It determines the vertical distance between the baselines of two consecutive lines of text. Adjusting the line-height can impact the readability and aesthetics of text on a webpage.

The em unit in CSS is relative to the ________.

  • Body background color
  • Font-size of the parent element
  • Screen width
  • Width of the border
The em unit in CSS is relative to the font-size of the parent element. It's a relative unit, making it valuable for creating scalable and responsive designs. When you set an element's font-size in ems, it's relative to its parent's font-size.

How can you ensure that a CSS transition applies only when a specific property changes?

  • By using the transition property without specifying any properties.
  • By using the all value for the transition-property property.
  • By creating a separate CSS class for each property you want to transition.
  • By defining multiple transition rules for each property.
To ensure that a CSS transition applies only when a specific property changes, you can use the transition-property property and set it to "all." This means the transition will be applied to all properties that change. If you want to target specific properties, you can list them individually in the transition-property property. Using "all" is a convenient way to apply transitions to all changing properties.

How can you ensure smoother animations when translating an element's position?

  • transform: translate(0);
  • transition: all 0.5s ease;
  • will-change: transform;
  • z-index: 10;
To ensure smoother animations when translating an element's position, you can use the will-change property with the transform value. This hints to the browser that the element's transform property will change, allowing the browser to optimize rendering. It's a good practice to use will-change for performance optimization in animations.

Which positioning value makes an element positioned relative to its original position?

  • absolute
  • fixed
  • relative
  • static
The positioning value that makes an element positioned relative to its original position is relative. When you set an element's position to relative, you can use properties like top, right, bottom, and left to move it relative to where it would have been in the normal document flow. This can be useful for fine-tuning element placement.

What does the animation-fill-mode property do in a CSS animation?

  • It specifies the animation duration.
  • It defines the timing function for the animation.
  • It controls the behavior of the element before and after the animation.
  • It sets the animation name.
The animation-fill-mode property is used to control the behavior of the animated element before and after the animation execution. It can have values like "none," "forwards," "backwards," and "both." "None" is the default value, which means the element doesn't maintain any styles before or after the animation. "Forwards" retains the styles after the animation ends, and "backwards" maintains the styles before the animation starts. "Both" keeps the styles both before and after the animation.

The ________ property in CSS is used to apply an animation to an element.

  • animation-delay
  • animation-duration
  • animation-iteration-count
  • animation-name
To apply an animation to an element in CSS, you use the animation-name property to specify the name of the animation defined with the @keyframes rule. This property associates the element with the animation it should use.

In a large project, you want to have separate SCSS files for variables, mixins, and base styles. How would you structure and integrate them into a main SCSS file?

  • Import the separate SCSS files for variables, mixins, and base styles at the beginning of the main SCSS file.
  • Manually copy and paste the content of the separate SCSS files into the main SCSS file.
  • Use JavaScript to dynamically load the separate SCSS files when needed.
  • Use external libraries to handle the integration of SCSS files.
To structure and integrate separate SCSS files, you should use the @import directive in the main SCSS file. Import the separate SCSS files for variables, mixins, and base styles at the beginning of the main SCSS file. This allows you to maintain a modular and organized codebase.