What is CSS?

Knowledge Videos

Short animated explainers, organised by subject.

What is CSS?

CSS styles a web page. A rule is a selector, a property and a value, and a link tag joins the style.css file to the HTML page.

Try it

Transcript

C S S is the language that describes how a page looks: colors, fonts and sizes. H T M L is the structure. C S S is the style.

A C S S rule has three parts. The selector says which elements to style. Inside curly brackets, a property says what to change, and a value says how.

This rule says: every h one gets the color blue. Add a rule for p, and every paragraph gets a bigger font. One rule styles every matching element.

Put your rules in a file called style dot c s s, and join it to the page with a link tag in the head. Now the page and its style are connected.

Remember: C S S styles a page. A rule is a selector, a property and a value, and a link tag joins the C S S file to the H T M L.

More in this series