CSS Flashcards
What are the names of the individual pieces of a CSS rule?
A CSS rule consists of a selector and a declaration block:
The selector points to the HTML element you want to style.
The declaration block contains one or more declarations separated by semicolons.
Each declaration includes a CSS property name and a value, separated by a colon.
In CSS, how do you select elements by their class attribute?
Syntax: .classname
In CSS, how do you select elements by their type?
Syntax: elementname
In CSS, how do you select an element by its id attribute?
Syntax: #idname
Name three different types of values you can use to specify colors in CSS.
Keywords (color names, such as red, blue or orange), RGB Values, HEX Codes, RGB functional notation, HSL functional notation (Hue/Saturation/Luminosity), HWB functional notation
What CSS properties make up the box model?
The CSS box model is essentially a box that wraps around every HTML element.
It consists of:
margins, borders, padding, and the actual content.
Which CSS property pushes boxes away from each other?
Margin
Which CSS property add space between a box’s content and its border?
Padding