You need to style a button differently when it's disabled. Which CSS pseudo-class would be most appropriate to achieve this?

  • :disabled
  • :hidden
  • :inactive
  • :unavailable
To style a button differently when it's disabled, you should use the :disabled pseudo-class. This pseudo-class is specifically designed to target elements that are in a disabled state, such as disabled buttons or form fields. It allows you to apply distinct styles to these elements when they are disabled. The other options, :inactive, :unavailable, and :hidden, do not target disabled elements and are not suitable for this purpose.

You want to overlay a button on top of an image. The button should be at the bottom right corner of the image. How would you position the button using CSS?

  • Position it absolutely and use "bottom: 0; right: 0;"
  • Position it absolutely and use "top: 0; left: 0;"
  • Position it relatively and use "bottom: 0; right: 0;"
  • Position it relatively and use "top: 0; left: 0;"
To overlay a button on the bottom right corner of an image, you should position it absolutely and use "bottom: 0; right: 0;" to place it at the specified location relative to its nearest positioned ancestor or the viewport.

Which CSS property specifies whether an animation should play in reverse on alternate cycles?

  • animation-alternate
  • animation-direction
  • animation-play-state
  • animation-reverse
The animation-direction property in CSS is used to specify whether an animation should play in reverse on alternate cycles. When set to alternate, the animation runs forwards, then in reverse, and so on, creating a back-and-forth animation effect. This property is valuable for creating visually interesting and dynamic animations.

What does the 'box-sizing' property with a value of 'border-box' do?

  • It adds extra space to the content box.
  • It applies a shadow border around the element.
  • It changes the background color to black.
  • It makes the element's content box include padding and border.
The 'box-sizing' property with a value of 'border-box' makes the element's content box include the padding and border, ensuring that the specified width or height of the element includes everything within it, making layout and sizing more predictable and intuitive.

What is the main advantage of using SCSS over plain CSS?

  • Smaller file size
  • Improved browser compatibility
  • Better performance
  • Advanced features like variables and nesting
The primary advantage of using SCSS over plain CSS is its advanced features, such as variables, nesting, and mixins. These features make the code more maintainable, reduce redundancy, and improve readability, which can significantly enhance the development process.

When using the "font-display" property, the value ________ ensures the text remains invisible until the font is loaded.

  • block
  • fallback
  • invisible
  • swap
In web development, the "font-display" property is used to control how fonts are displayed. The value swap tells the browser to render text with system fonts until the custom font is loaded, making the text remain invisible until the custom font is ready.

Which property in CSS is used to set the width of the content area of an element?

  • Border
  • Margin
  • Padding
  • Width
In CSS, the 'width' property is used to set the width of the content area of an element. It controls the width of the element's content, excluding padding, border, and margin.

To use a custom property in your styles, you reference it with the ________ syntax.

  • # symbol
  • $ symbol
  • & symbol
  • @ symbol
To use a custom property in your styles in CSS, you reference it with the @ symbol. Custom properties, also known as CSS variables, are defined using the :root pseudo-class, and their values can be accessed and used in your styles by prefixing the custom property name with the @ symbol.

How does the inherit value in CSS function?

  • It applies a default value to the element.
  • It has no effect on the element's styling.
  • It makes the element inherit the computed value of the property from its parent element.
  • It prevents inheritance from the parent element.
The inherit value in CSS makes the element inherit the computed value of the property from its parent element. It ensures that the property's value is taken from the parent element, allowing for consistent styling throughout the document.

The CSS @keyframes rule lets you create ________ over a set duration.

  • animations
  • transforms
  • transitions
  • variables
The @keyframes rule in CSS is used to create animations over a set duration. You define specific animation steps within the @keyframes rule, and then you can apply this animation to elements using the animation property. It allows you to control how an element changes over time.