css-syntax Flashcards

1
Q

What are the names of the individual pieces of a CSS rule?

A

The names of the individual pieces of a CSS rule are the selector, declaration block, declarations, properties, and values. The selector goes before the declaration block. Declarations are inside the block and have properties and values.

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 by their class attribute, use the class selector which has a period before the class name in the css stylesheet. An example would be “.title{ property: value }

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 tag name?

A

To select an element by their tag name simply enter the name of the tag such as body, h1, h2, img; then add property value combinations.

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 by its id attribute, in the CSS stylesheet add a # before the id attribute name. An example would be: “#title { property: value }”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly