|
|
@ -26,9 +26,11 @@ style it with [CSS][0]. Create a CSS file, [link it][1] to your |
|
|
|
- `upper-body` with a "blueviolet" `background-color` |
|
|
|
- `upper-body` with a "blueviolet" `background-color` |
|
|
|
- `lower-body` with a "lightsalmon" `background-color` |
|
|
|
- `lower-body` with a "lightsalmon" `background-color` |
|
|
|
|
|
|
|
|
|
|
|
To style an element, you systematically have to declare [rulesets][5], composed |
|
|
|
### Code examples |
|
|
|
of a property and a value. Here is an exemple of how to set the color of `div` |
|
|
|
|
|
|
|
tags to `"red"`: |
|
|
|
To style an element, you systematically have to declare [rulesets][5], composed of a property and a value. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Set the color of `div` tags to `"red"`: |
|
|
|
|
|
|
|
|
|
|
|
```css |
|
|
|
```css |
|
|
|
div { |
|
|
|
div { |
|
|
@ -36,6 +38,14 @@ div { |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Set the `background-color` of the HTML element with the `id` `"block-1"`: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```css |
|
|
|
|
|
|
|
#block-1 { |
|
|
|
|
|
|
|
color: red; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
### Expected output |
|
|
|
### Expected output |
|
|
|
|
|
|
|
|
|
|
|
This is what you should see in the browser: ![screenshot][8] |
|
|
|
This is what you should see in the browser: ![screenshot][8] |
|
|
|