Summary
In this lesson, we learned that:
- CSS (Cascading Style Sheets) is the language that describes how web pages look: colors, fonts, backgrounds, spacing and layout. HTML describes what is on a page, CSS how it looks.
- A declaration, such as
color: blue, consists of a property (what to change) and a value (what to change it to), separated by a colon. Several declarations are separated by semicolons. - A rule consists of a selector, which selects the elements, and declarations in curly braces:
p { color: green; }. - There are three ways to add CSS to a page:
- inline styles, in the
styleattribute of an element, - the
styleelement inhead, for one page, - an external stylesheet, a
.cssfile linked inheadwith<link rel="stylesheet" href="style.css">.
- inline styles, in the
- External stylesheets are the most common: many pages can share one stylesheet, and HTML and CSS stay apart.
In the next lesson, CSS Selectors, you’ll learn to select exactly the elements you want to style, and you’ll find out what happens when several rules style the same element.
Instructions
- 1
Congratulations on completing the first CSS lesson!