Name: __________________________
CSS Syntax Practice Sheet
Syntax: selector {property: value; }
1.
<p> {text-align: left;}
2.
h1 {
color: red
text-align: center
}
3.
li {
color: red;
font-weight: bold;
4.
p { color; blue; }
5.
li font-size: 12px;
6.
li {
color="red";
}
7.
h1
font-family: courier;
font-weight: bold;
color: blue;
text-align: center;
}
Answer Key
1. <p> {text-align: left;} has greater and less than signs around the selector and should be p {text-align: left;}
2. Both the red and center property values should end with semicolons
3. Missing the closing curly brace
4. p { color; blue; } uses a semicolon in place of a colon and should be p { color: blue; }
5. li font-size: 12px; is missing both curly braces and should be
li { font-size: 12px; }
6. color="red"; should be color:red;
7. Missing the opening curly brace