In Flexbox, which property is used to align items vertically in the container?

  • align-content
  • align-items
  • align-self
  • justify-content
The align-items property is used to align items vertically in a Flexbox container. It applies to the container and defines the default alignment for its items.

To prevent a background gradient from repeating, you would set the background-repeat property to ________.

  • anti-repeat
  • no-repeat
  • non-repeating
  • stop-repeat
To prevent a background gradient from repeating, the "no-repeat" value is set for the background-repeat property. This ensures that the gradient is displayed only once, without repetition, creating a seamless background.

The ________ utility in Tailwind CSS is used to apply different styles based on the user's screen size.

  • lg: (large)
  • md: (medium)
  • sm: (small)
  • xl: (extra-large)
In Tailwind CSS, the md:, lg:, sm:, and xl: utilities are used to apply styles at different breakpoints, allowing for responsive design based on screen sizes.

To create a gap between grid items in CSS Grid, the grid-________ property is used.

  • row-gap
  • item-gap
  • gap
  • column-gap
The correct option is 3. The gap property is used to create a gap between grid items in CSS Grid, and it works for both rows and columns.

Can a more specific CSS selector override a rule marked as !important?

  • It depends on the order of the rules in the stylesheet.
  • No, !important always takes precedence.
  • Only if the rule is applied to a child element.
  • Yes, always.
No, a more specific selector cannot override a rule marked as !important. The !important declaration gives a rule the highest specificity, making it extremely difficult to override, regardless of the selector's specificity.

How can the clear property in CSS be used in relation to floated elements?

  • Clear property adjusts the transparency of an element.
  • Clear property controls the spacing between lines of text in an element.
  • Clear property determines the text color of an element.
  • Clear property is used to control the behavior of an element when it wraps around a floated element.
The clear property is used to control the behavior of an element concerning floated elements. It specifies whether an element should be moved below, above, or beside the floated elements.

Which unit of measurement in CSS is relative to the font-size of the parent element?

  • %
  • em
  • px
  • rem
In CSS, the 'em' unit is relative to the font-size of the parent element, providing a scalable and flexible way to define sizes. 'px' is fixed, 'rem' is relative to the root element, and '%' is a percentage of the parent element's font-size.

Which CSS transform property is used to change the size of an element?

  • scale()
  • resize()
  • transform-size
  • size()
The correct option is scale(). This property is used to change the size of an element by specifying a scaling factor. For example, transform: scale(2) will make the element twice as large.

What is the role of the animation-iteration-count property in CSS?

  • It controls the speed of the animation.
  • It defines the number of iterations an animation should have before stopping.
  • It sets the delay before starting the animation.
  • It specifies the duration of each iteration in milliseconds.
The animation-iteration-count property determines how many times an animation cycle should be played. For instance, animation-iteration-count: 3; means the animation will play three times before stopping.

In a mobile-first approach, media queries are used primarily to add what kind of features for larger screens?

  • Add additional styles and features
  • Add complexity and enhance styles
  • Remove unnecessary styles
  • Simplify the layout
In a mobile-first approach, media queries are employed to selectively add styles and features for larger screens, optimizing the user experience on desktops and larger devices.

To increase the specificity of a class selector without adding more elements or IDs, you can __________ the class name in the selector.

  • Extend
  • Nest
  • Override
  • Repeat
When you need to increase the specificity of a class selector in CSS without adding more elements or IDs, you can use the :extend() pseudo-class to extend the class name in the selector.

The property ________ is used to control the horizontal and vertical alignment of an element's border box within its containing block.

  • align-box
  • box-align
  • align-content
  • box-content
The correct option is align-content. This property is used to control how the browser distributes space around and between content items along the main or cross-axis. In the context of borders, it can adjust their alignment within the container.