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])

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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 {
...
{
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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 {
...
{
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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 {
...
{
How well did you know this?
1
Not at all
2
3
4
5
Perfectly