Basic Structure Video
In its most basic form, CSS looks like this.
The description is as follows.
- The selector points to the HTML element you want to style.
- The declaration block contains one or more declarations separated by semicolons.
- Each declaration includes a CSS property name and a value, separated by a colon.
- End CSS declarations with a semicolon
- Surround declaration blocks by curly braces
source - w3schools.com
For example, you might have a style that looks like this.
body {
bgcolor: pink;
text-align: center;
}
- body is the selector
- bgcolor and text-align are part of the declaration and is the CSS property name. The declaration block contains the declarations separated by a semicolons important!. { } braces surround the declaration block.
- Finally, pink and center are also part of the declaration but are the values of the properties.