The primary purpose of functions in SASS is to ________.

  • Calculate mathematical expressions
  • Create loops
  • Define variables
  • Group CSS properties
The primary purpose of functions in SASS is to calculate mathematical expressions. SASS functions can perform various mathematical operations, making it easy to compute values for CSS properties dynamically. They are valuable for maintaining consistency and making stylesheets more maintainable.

Which modular CSS methodology uses the Block, Element, Modifier structure?

  • BEM (Block, Element, Modifier)
  • ITCSS (Inverted Triangle CSS)
  • OOCSS (Object-Oriented CSS)
  • SMACSS (Scalable and Modular Architecture for CSS)
The modular CSS methodology that uses the Block, Element, Modifier structure is BEM, which stands for Block, Element, Modifier. BEM is a naming convention that helps create maintainable and predictable CSS code by organizing styles into blocks, elements, and modifiers.

While using a CSS preprocessor, you notice that the compiled CSS has selectors that are excessively long and specific. What might be a potential cause for this in your source files?

  • Overuse of nesting in SASS or LESS
  • Lack of CSS optimization tools
  • Errors in the preprocessor settings
  • Incorrect order of imported stylesheets
Excessively long and specific selectors in compiled CSS are often caused by overusing nesting in preprocessors like SASS or LESS. While nesting can improve code organization, it can also lead to overly specific selectors that increase file size and reduce maintainability.

If you want an animation to alternate between running forwards and backwards, you would use the animation-direction value of ______.

  • alternate
  • alternate-reverse
  • repeat
  • reverse
To make an animation alternate between running forwards and then backwards, you would use the value alternate for the animation-direction property. This creates a back-and-forth effect for the animation, making it appear as if it's reversing after each cycle.

You have an element inside a container. The container has a font-size of 20px. If you set the child element's font-size to 1.5em, what will be its computed font-size?

  • 10px
  • 15px
  • 20px
  • 30px
When you set the child element's font-size to 1.5em, it multiplies the parent element's font-size. In this case, 1.5em x 20px = 30px. So, the computed font-size of the child element will be 30px.

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.