Documents Referenced:
- Cascading Style Sheets (CSS) is a language that focuses on how a website is styled and presented to users.
- CSS allows you to override the interal HTML style sheet to control exactly how each HTML element looks in the browser.
Basic Styling you can Change:
- color
- size
- layouts
- animiations
- Rules control specifically how each element type are styled
General Features of the Syntax
- Selector: selects the HTML element being styled
- Curly Braces
{}: contain the properties and values modifying a given element - Declarations:
- Property: a characteristic associated with an element (placed prior to the colon)
- Value: controls the outcome of the property characteristic (comes after the colon)
h1 {
color: red;
font-size: 5em;
}New CSS features are developed by a team of professionals, but are ultimately only useful if adapted accross one or more browsers.
There are three (3) ways to insert CSS styling:
- External CSS: styling is controlled with an external .css file, which must be linked in the html document.
- Internal CSS: styling is controlled in the
<head>of the html document. This is best if one html page has specific style requirements. - Inline CSS: styling is applied to the elment of an html page in the attributes, but this looses advantages associated with External/Internal styling so use sparingly.
If multiple style sheets reference the same element, the value from the last last read sheet will be used.
Style priorities:
- Inline Style (highest priority)
- External/Internal Style
- Browser Default (lowest priority)