The following is the syntax of a style rule for embedded and external styles.
It includes the HTML element as the selector and the declaration (property and value)
The CSS syntax is made up of three parts: a selector, a property and a value
The Syntax:
selector {property: value; property: value;}
Looks like:
h1{color:red; text-align:center; }
h1 is the selector
color and text-align are the properties
color has the value red
text-align has the value center
Can also look like:
h1{
color:red;
text-align:center;
}
It is easier to read in this vertical layout. Like HTML, extra spaces and lines in the code does not effect how the browser interprets the code.
Directions:
- enter the selector you want to define characteristics for, such as h1
- use the { bracket to start the rule
- use } to end the rule
- inside the brackets, list the characteristics you want the tag to use
- list the property
- use the colon (:) to separate the property from its value
- list the value
- use a semi-colon (;) to separate each characteristic.
This new rule will effect the presentation of all the content inside any and all h1 tags on your web page(s).