Practice Quiz #5: CSS Fundamentals
An inline style uses curly braces ({}).
False
Which of the following is known as the CSS universal selector?
*
What is the proper syntax to declare a CSS variable set to black?
--section-color: black;
Of the following, select all valid pseudo-class selector examples.
:empty :enabled :hover :lang(language)
What selector must a CSS variable be declared in to have global scope?
:root
The child selector, specified by using what symbol between two selectors, matches any elements where the second element is a direct child of the first element?
>
Which of the following is the definition of a CSS declaration?
A CSS property followed by a colon (:) and the property value
Select the selector name that correctly matches the CSS selector used. .hidden { background-color: yellow; }
Class
Choose the selector name that correctly matches the CSS selector used. td { background-color: yellow; }
Element
Inline styles cannot be used with embedded stylesheets or external stylesheets.
False
True or false? A CSS variable is defined with two slashes (//) preceding the variable name.
False
True or false? An HTML tag class attribute specifies the classes to which the tag belongs, with each class name separated by a comma (,).
False
Of the following, select the valid ways that we can specify color.
Hexadecimal color HSL color value RGB color value RGBA color value
Which of the following is the definition of a CSS declaration block?
One or more declarations separated by semicolons (;)
How is an attribute selector created in CSS?
Specified with an attribute name and optional value comparison enclosed in square brackets ([ and ]).
Which of the following is the definition of a CSS selector?
The HTML elements to which the specific style rule applies
True or false? A website should use an external stylesheet to create styles that apply to all web pages.
True
True or false? An inline style does not use a selector.
True
True or false? CSS properties float and clear control how text flows around HTML elements, making web pages look like a magazine or newspaper article where the article text wraps around the images on a page.
True
True or false? CSS style declarations override the default browser style declarations.
True
True or false? It is a good practice to place each declaration on a separate line and to add a semicolon to the end of each declaration block, even when a semicolon is not required, so that adding the semicolon is not forgotten later when adding more declarations.
True
True or false? Pseudo-class selectors match elements based on user behavior or meta-information about HTML elements.
True
True or false? The !important rule may be used on a style declaration to override other declarations and disregard specificity.
True
True or false? The inline-block display property value displays the contents of the element as a block element, but formats the element as an inline element.
True
True or false? The pseudo element selector, specified with two colon characters (::) followed by a pseudo-element, matches parts of elements.
True
In CSS, what is inheritance?
When style declarations from a parent element cascade down and are applied to any child elements.
Which CSS selector, specified by using a plus character (+) between two selectors, matches an element that immediately follows another element, where both elements have the same parent?
adjacent sibling
Of the following, select all selectors known as combinators.
adjacent sibling child descendant general sibling
The box model references which of the following components of all HTML elements?
border content margin padding
Of the following, select all valid selector types used in CSS.
class descendant element id pseudo-class
An absolute size is a size that is fixed and independent of other CSS sizes. Of the following, select all absolute size units.
cm - centimeters in - inches mm - millimeters pc - pica pt - points px - pixels
What is the proper syntax to use a CSS variable called --section-color?
color: var(--section-color);
A CSS rule consists of which three (3) of the following parts?
declaration declaration block selector
Which selector name correctly matches the CSS selector used. td { background-color: yellow; }
descendant
Of the following, select the valid ways CSS can be implemented.
embedded external inline
Which CSS selector, specified using a tilde character (~) between two selectors, matches the second element if the second element occurs after the first element and both elements are siblings?
general sibling
Which of the following are valid float property values?
left none right
What is a selector called that includes a comma-delimited list of selectors at the beginning of one CSS rule?
multiple selector
Which abbreviation represents an Absolute length unit?
px
What does the CSS color property control?
text color