How do you define a CSS variable within a root element?

  • #variable: value;
  • $variable: value;
  • --variable: value;
  • var variable = value;
To define a CSS variable within a root element, you use the syntax --variable: value;. This sets up a custom property that can be later used throughout the stylesheet.

What is the significance of the 'viewport' attribute in an SVG used in a web page?

  • Defines the visible area of an SVG image
  • Determines the zoom level of the SVG
  • Sets the width and height of the SVG element
  • Specifies the position of the SVG on the web page
The 'viewport' attribute in an SVG defines the visible area of the image. It is crucial for responsive design, allowing developers to control how the SVG scales and fits within its container on different devices.

________ is a CSS property that controls the presentation of underlines, overlines, and line-throughs applied to text.

  • decoration
  • line
  • style
  • text-decoration
The correct option is text-decoration. This CSS property is used to control the presentation of text decorations, including underlines, overlines, and line-throughs. It offers various values to customize the style of text decoration.

Which CSS framework uses utility classes as its core approach to styling?

  • Bootstrap
  • Bulma
  • Foundation
  • Tailwind CSS
Tailwind CSS is a utility-first CSS framework, meaning it provides low-level utility classes for styling rather than pre-designed components. Developers can compose styles directly in the markup, offering flexibility and simplicity in styling.

What is the difference between a pseudo-class and a pseudo-element in CSS?

  • Pseudo-classes select a part of an element, like the first line.
  • Pseudo-classes select elements based on their state or position.
  • Pseudo-elements select and style a part of an element, like the first line.
  • Pseudo-elements select elements based on their state or position.
Pseudo-classes target states or positions of elements, while pseudo-elements style specific parts of elements. Understanding this distinction is crucial for precise CSS styling.

In the context of web performance, what does the term "critical rendering path" refer to?

  • The hierarchy of HTML elements on a page
  • The order of CSS rules in a stylesheet
  • The path users take to access a website
  • The sequence of steps browsers take to render the content
The critical rendering path is the sequence of steps the browser takes to process and render the content of a web page. It includes tasks like parsing HTML, loading external resources, and rendering the DOM and CSSOM, all of which influence the time it takes for a page to become visible to users.

In SASS, using !________ with a variable makes it globally accessible, overriding local scope.

  • global
  • global-scope
  • globalize
  • important
The correct answer is "important." When you use !important with a SASS variable, it makes the variable globally accessible, overriding any local scopes. This is useful when you want to ensure a specific style takes precedence throughout your stylesheets, but should be used judiciously to avoid potential issues with maintainability and readability.

In a design where text needs to appear as though it is glowing, what CSS property should be used to create this effect, and how should it be manipulated to achieve the glow?

  • text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
  • color: #fff; text-shadow: 0 0 5px rgba(255, 255, 255, 0.7), 0 0 10px rgba(255, 255, 255, 0.7);
  • font-color: #fff; text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
  • text-shadow: 0 0 5px rgba(255, 255, 255, 0.7), 0 0 10px rgba(255, 255, 255, 0.7);
Option 2 is correct. It sets the text color to white and applies a text shadow with a glow effect using rgba values for transparency.

In CSS Grid, what is the purpose of the grid-auto-flow property?

  • It defines the algorithm used to place grid items in the grid.
  • It determines the direction of the explicit grid.
  • It sets the size of the gaps between columns and rows.
  • It specifies the size of the implicit grid tracks.
The grid-auto-flow property in CSS Grid is used to define the algorithm for placing grid items in the grid when they don't explicitly specify a placement. It can be set to row, column, dense, or row dense. This property is significant in controlling the layout of grid items and ensuring a dynamic and responsive grid structure.

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

  • Apply a shadow effect to the border of an element.
  • Increase the font size of an element.
  • Make the background color of an element transparent.
  • Move an element to the left or right, allowing other elements to wrap around it.
The float property is used to move an element to the left or right, allowing other elements to wrap around it. It's commonly used for creating layouts with multiple columns.