In CSS, when a variable is not set or its value is invalid, it will return the ________ value.

  • Default
  • Initial
  • Null
  • Undefined
In CSS, when a variable is not set or its value is invalid, it will return the default value. This default value varies depending on the property. For example, the default value for the font-size property is often 16 pixels.

Which CSS property is used to set the font family for an element?

  • font-family
  • font-size
  • font-style
  • font-weight
The font-family property in CSS is used to specify the font family for an element. This property allows you to define the typeface or font you want to use for text within that element, which can greatly affect the visual style of your website.

How can you include a custom font in your webpage using CSS?

  • Use the font-color property and specify the font's name
  • Use the font-family property and specify the font's name
  • Use the font-size property and specify the font's URL
  • Use the text-transform property and specify the font's path
To include a custom font in your webpage using CSS, you use the font-family property and specify the font's name. You need to first import the font into your CSS file or link to an external font file, and then you can reference it using the font-family property in your CSS rules. This allows you to apply the custom font to specific text elements on your webpage.

What does the flex-wrap property control in a flex container?

  • It controls the alignment of flex items within the container.
  • It defines the direction in which flex items stack within the container.
  • It determines how flex items wrap when they exceed the container's width.
  • It specifies the amount of space between flex items.
The flex-wrap property in a flex container controls how flex items wrap when they exceed the container's width. It can be set to nowrap to prevent wrapping, wrap to allow wrapping in a single line, or wrap-reverse to wrap in the opposite direction.

What is the primary function of Autoprefixing in CSS development?

  • Adding vendor prefixes to CSS properties
  • Automatically adjusting font sizes
  • Generating responsive images
  • Minifying CSS code
Autoprefixing in CSS development is primarily used to automatically add vendor prefixes to CSS properties. These prefixes are necessary to ensure cross-browser compatibility. When you use CSS properties like "flex" or "grid," different browsers may require different prefixes (e.g., -webkit-, -moz-, -ms-) to render these properties correctly. Autoprefixing tools simplify this process, making your CSS code work consistently across various browsers.

An element with display: none; differs from visibility: hidden; because the former ________.

  • Flips the element upside down
  • Hides the element but reserves its space
  • Makes the element transparent
  • Removes the element from the layout
An element with display: none; removes the element from the layout entirely. It doesn't occupy any space, and other elements act as if it's not there. In contrast, visibility: hidden; hides the element but still reserves its space in the layout.

Which CSS property is typically used to set breakpoints in responsive design?

  • @media
  • breakpoint
  • media
  • query
In responsive web design, the @media rule is used to set breakpoints. It allows you to define specific CSS styles that apply when certain conditions are met, such as screen width or orientation. By using @media queries, you can create responsive layouts that adjust to different screen sizes, making your website look and function well on various devices.

What is the primary purpose of the grid-template-areas property?

  • To control the alignment of grid items
  • To define the background color of grid areas
  • To set the font style for grid items
  • To specify the layout of the grid by assigning a name to grid areas
The primary purpose of the grid-template-areas property is to specify the layout of the grid by assigning a name to grid areas. This allows for a visual representation of the grid structure and helps in creating complex and responsive layouts with CSS Grid.

In a media query, which feature is commonly used to detect the width of the viewport?

  • device-width
  • resolution
  • screen-size
  • viewport-width
The device-width feature is commonly used in media queries to detect the width of the viewport. It specifically targets the width of the output device, which is important for creating responsive designs that adapt to different screen sizes. By using device-width in media queries, you can apply different styles and layouts based on the device's screen width.

What is the primary purpose of the filter property in CSS?

  • Applying colors to text
  • Applying transformations to elements
  • Applying visual effects to elements
  • Controlling the layout of elements
The primary purpose of the filter property in CSS is to apply visual effects to elements. This property allows you to add various effects like blurring, brightness adjustment, and grayscale to an element. It's commonly used for image effects and enhancing the visual appearance of web content.