SYNTAX
Syntax is a set of rules that tell us
what arrangements of characters
create a valid statement in a language.
This tells the computer how to read the
code
Two Parts of a Syntax
Selector - points to the HTML element
you want to style.
Declaration Block - includes a property
name and a value, separated by a
colon.
1.
2.
p is a selector in CSS (it points to the HTML element
you want to style: <p>).
color is a property, and red is the property value
text-align is a property, and center is the property
value.
When you are working on a lot of
elements, it is important to group selectors
to apply the same style to all.
Grouping Selectors
p, h1 {
font-family: Calibri;
}
Two Ways of Grouping Selectors
Class - can be assigned to multiple
HTML elements.
ID - unique name for one specific
element only.
1.
2.