Which of the following is NOT a unit for font-size in CSS?

  • cm
  • em
  • ex
  • px
In CSS, font-size can be specified in various units, including em, ex, px, and cm. However, 'cm' is not a common unit for font-size. It's typically used for specifying dimensions of other elements, like margins or padding.

Which extension is used for SCSS files?

  • .css
  • .scss
  • .html
  • .js
SCSS (Sassy CSS) files have the ".scss" extension. This extension is used to indicate that the file contains SCSS syntax, which is a more CSS-like syntax with additional features provided by SASS.

The pseudo-class :nth-of-type(2) in CSS targets the ________ of its type.

  • any element
  • first element
  • last element
  • second element
The pseudo-class :nth-of-type(2) in CSS targets the second element of its type. It allows you to select and style the second occurrence of an element type within its parent container. This is useful for creating specific styles for the second element, such as the second paragraph or the second list item.

In a React application, you are tasked with styling a button that changes its background color based on a prop passed to it. Which CSS-in-JS library would be ideal for this?

  • Styled-components
  • Bootstrap
  • Tailwind CSS
  • SCSS
Styled-components is a popular CSS-in-JS library for React. It allows you to define component styles directly in your JavaScript code and can easily style components based on props, making it ideal for dynamic styling based on prop values.

The cubic-bezier function for animation-timing-function takes in ______ arguments to define the curve.

  • 1
  • 2
  • 3
  • 4
The cubic-bezier function in CSS, used for defining custom timing functions for animations, takes in three arguments. These three arguments represent the control points of the cubic Bezier curve, allowing precise control over the animation's progress.

The value calc() in CSS allows you to perform ________.

  • Animation effects
  • Conditional statements
  • Mathematical operations on numeric values
  • Text manipulation
The value calc() in CSS allows you to perform mathematical operations on numeric values. It is a powerful feature that enables you to calculate values for various CSS properties, making it useful for responsive design and layout.

You've noticed that your web fonts are causing a delay in page rendering. Which property can you adjust to control how these fonts are displayed during the load process?

  • font-display
  • font-family
  • font-rendering
  • font-weight
To control how web fonts are displayed during the load process, you can adjust the font-display property in CSS. This property allows you to specify how the browser should handle font loading and rendering, with options like auto, swap, block, fallback, and optional. It helps you optimize the user experience when web fonts are slow to load or unavailable.

To apply an ease-in-out timing function to a transition, you'd set transition-timing-function to ________.

  • ease-in
  • ease-in-out
  • ease-out
  • linear
In CSS transitions, the transition-timing-function property controls the timing function for the transition. The ease-in-out option creates a smooth transition that starts slowly, accelerates in the middle, and slows down at the end. This is a common choice for animations that feel natural and pleasing to the eye.

Which CSS property allows you to control the speed curve of an animation?

  • animation-ease
  • animation-speed-curve
  • animation-timing-function
  • animation-transition
The animation-timing-function property is used to control the speed curve of an animation. It allows you to specify how the animation progresses through time, giving you control over the easing and acceleration of the animation.

The CSS unit vh represents a percentage of the ________.

  • Font Size
  • Height
  • Viewport
  • Width
The CSS unit 'vh' represents a percentage of the viewport's height. This means that 1vh is equal to 1% of the height of the viewport in which the web page is displayed. It's a relative unit often used for responsive design.