CSS is another kind of markup. You can use it to style your pages. It's really powerful, almost like a programming language, but it's really easy to do things like change colors, fonts, and pictures.
It works by setting rules for different parts of your page. You usually set them in the style
element of the page or in a separate file.
You name the HTML you want to style, and then describe your styles.
It looks like this
p {
color: red;
}
which translates to
THING YOU WANT TO STYLE {
KIND OF STYLE: STYLE SETTING;
}
You can address any HTML element as a thing. You can also add your own labels to any HTML element. If you want to add the same label to a bunch of elements on a page you use a class
. If you want to label only one element, you use an id
. Javascript also uses these to find the part of the page you want it to cast its spell on.
Look at the code of this page to see if you can figure out how the following works.