Which pseudo-class would you use to target an element when it's being hovered over by a mouse pointer?

  • :active
  • :focus
  • :hover
  • :visited
The :hover pseudo-class is used to target an element when it's being hovered over by a mouse pointer. This is commonly used to apply styles or behaviors to elements when a user hovers their cursor over them. For example, you can change the background color of a button when it's hovered over to provide feedback to the user.

In SASS/SCSS, what is the primary difference between a mixin and a function?

  • Functions are used for reusable styles, while mixins are for reusable logic
  • Functions can be called multiple times within a rule, but mixins cannot
  • Mixins can accept arguments, but functions cannot
  • Mixins can produce CSS rules, but functions cannot
The primary difference between a mixin and a function in SASS/SCSS is that functions are used for reusable styles and can return values, while mixins are used for reusable logic and can generate CSS rules. Mixins can accept arguments, which allows for more dynamic behavior, whereas functions are typically used for calculations and value generation.