Syntax Flashcards
1
Q
What are the names of the individual pieces of a CSS rule?
A
A selector followed by a declaration block.
Eg. selector {declaration block}
A declaration block consists of one or more declarations nested inside curly braces.
A declaration is defined with
a property :(colon) value;(semicolon)
Eg. color: red;
Property is color and value is red.
2
Q
In CSS, how do you select elements by their class attribute?
A
.classAtrributeValue { }
Eg. .page { }
3
Q
In CSS, how do you select elements by their tag name?
A
elementTagName { }
Eg. h1 { }
4
Q
In CSS, how do you select an element by its id attribute?
A
idAtrributeValue { }