What is the purpose of the CSS border-style property?

  • Controls the spacing between elements
  • Defines the style of the border
  • Sets the width of the border
  • Specifies the color of the border
The border-style property in CSS is used to define the style of the border of an element. It can take values like solid, dotted, dashed, etc., to determine the appearance of the border.

Which CSS position value is NOT relative to the normal document flow?

  • absolute
  • fixed
  • relative
  • static
In CSS, the 'static' position value is the default and is not positioned relative to the normal flow.

Describe how CSS custom properties (CSS Variables) can be used to streamline the management of color schemes in a stylesheet.

  • CSS Variables cannot be used for managing color schemes.
  • They allow you to define a color only once and reuse it throughout the stylesheet.
  • They are limited to specific elements and cannot be reused.
  • They are only applicable to text color, not background color.
CSS custom properties enable the definition of variables for colors, making it easy to maintain a consistent color scheme by changing the variable value.

To evenly distribute space around flex items, the property justify-content should be set to ________.

  • space-evenly
  • space-around
  • space-between
  • center
The correct option is space-around. This value evenly distributes the space around flex items, placing an equal amount of space on each side of each item. space-evenly would also work, but it includes space at the edges, which might not be desired in all cases. space-between would leave no space at the edges. center is not a valid option for justify-content.

The CSS pseudo-class :________ is particularly useful for improving accessibility for users who navigate primarily via keyboard.

  • hover
  • focus
  • active
  • target
The correct option is focus. The :focus pseudo-class is used to apply styles when an element is in focus, making it crucial for improving accessibility for keyboard navigation.

In the context of web design, what does DPI stand for?

  • Data Processing Index
  • Digital Pixel Integration
  • Document Processing Interface
  • Dots Per Inch
In web design, DPI stands for Dots Per Inch. It refers to the measure of the printing resolution and is commonly used to describe the density of dots in an inch of a printed document.

In SASS, ________ is a powerful feature that allows styles to be applied based on a set of conditions.

  • if/else
  • @media
  • @if
  • @extend
The correct option is @if. This feature in SASS allows styles to be conditionally applied based on certain conditions. It enhances the flexibility and maintainability of stylesheets by providing a way to apply styles selectively.

How can you create a gradient that appears as stripes with equal width using CSS?

  • Linear-gradient(to right, white 1px, transparent 1px)
  • Linear-gradient(white 1px, transparent 1px)
  • Repeating-linear-gradient(white 1px, transparent 1px)
  • Striped-gradient(white, transparent)
To create stripes with equal width in a gradient, you can use the repeating-linear-gradient property. This ensures that the gradient is repeated at regular intervals, creating the appearance of stripes with equal width.

When building a theme with interchangeable colors, which approach using CSS or SASS variables would allow the most flexibility for theme variations without changing the underlying structure?

  • !important
  • CSS Custom Properties
  • Color Functions
  • SASS Variables
SASS variables offer greater flexibility for theme variations as they can be easily changed without altering the underlying structure. They provide a centralized way to manage color variations in a theme, making it more maintainable and adaptable.

If a developer wants to add a special icon before the content of a hyperlink to indicate that it opens in a new window, which pseudo-element should they use to achieve this without altering the HTML markup?

  • ::after
  • ::before
  • ::first-letter
  • ::first-line
The '::before' pseudo-element can be used to insert content before the content of the selected element, allowing the addition of a special icon before the hyperlink content.

You're optimizing a web page's load time and observe that the Critical Rendering Path is being impacted by large CSS files. What strategy would you adopt to optimize the CSS delivery for better performance?

  • Splitting CSS into smaller critical and non-critical files
  • Inlining all CSS in the HTML document
  • Enabling browser caching for CSS files
  • Using data URIs for CSS background images
Splitting CSS into smaller critical and non-critical files can optimize the Critical Rendering Path. Other options may have benefits, but this strategy directly addresses the impact of large CSS files on rendering.

What is the difference between opacity and alpha transparency in CSS color definitions?

  • Opacity is applied to block-level elements, while alpha transparency is for inline elements.
  • Opacity is controlled by the opacity property, while alpha transparency is controlled by the transparent keyword.
  • Opacity is used for text transparency, while alpha transparency is used for background transparency.
  • Opacity refers to the overall transparency of an element, affecting both the element and its children. Alpha transparency, achieved through RGBA or HSLA, allows specifying the transparency of the element only, not affecting its children.
Opacity and alpha transparency serve different purposes. Opacity affects both the element and its children, while alpha transparency, achieved through RGBA or HSLA, only affects the transparency of the element itself.