CSS-SYNTAX Flashcards
1
Q
What are the names of the individual pieces of a CSS rule?
A
A CSS rule contains two parts: a selector and a declaration.
(Note: Additional spaces have been added here and there to abide by the website’s display rules. [Cannot display code without premium version])
2
Q
In CSS, how do you select elements by their class attribute?
A
To select an element in CSS by using their class attribute, you must include a period before the selector. EX: .body { ... {
3
Q
In CSS, how do you select elements by their type?
A
To select an element in CSS by using their type, you must match the name of the element that is already in HTML. EX: body { ... {
4
Q
In CSS, how do you select an element by its id attribute?
A
To select an element in CSS by using their id attribute, you must include a pound/hashtag before the selector. EX: #body { ... {