## Lecture 1 (13:00) - Intro to CSS ### Style Rules - CSS associates rules with HTML elements - These rules govern how content of specified elements should be displayed - Selector - Indicates the element(s) the rule applies on - Declaration - Indicates how said elements should be formatted #### Example 1 ```css p { font-family: Arial; } ``` - `p` here is the selector - it indicates all `
` elements should be selected. - `{ font-family: Arial; }` is the declaration - indicating that all selected elements should be styled in the font family of Arial. #### Example 2 ```css h1, h2, h3 { font-family: Arial; color: yellow; } ``` - Selector: `h1, h2, h3` are selected - Declaration: `font-family: Arial; color: yellow;`. All text will be yellow Arial text. ### Using External CSS - In the `
` of the HTML page, we can link a CSS file for the browser to use for the current page. It takes 3 attributes: - **href** - path to CSS file - **type** - the type of document being linked (`text/css`) - **rel** - relationship to the HTML files (`stylesheet`) #### Example ```html