The document discusses Cascading Style Sheets (CSS) and how to style HTML elements using CSS. It covers CSS selectors like tags, IDs, and classes. It also describes the different ways to apply CSS like internal, external, and inline stylesheets and how CSS rules cascade. The document provides examples of CSS rules for backgrounds, text, fonts, and links.
2. what is css?
Cascading Style Sheets
A set of rules on how to display your
HTML elements
Internal documents: embedded in the
head part of the HTML file
External documents: something.css
4. SELECTORS
Tag/element: p{color:black;}
<p>This text will be black</p>
ID: #alternate {color:green;}
<p id=alternate>This will be
green</p>
Class: .another{color:blue;}
<p class=another>While this will
be blue</p>
5. MORE SELECTORS
Element-specific: p.red
{color:red;}
<p class=red>This text will be
red</p>
Multiple elements: .title, .head
{color:pink;}
<h1 class=head>Pink Heading</h1>
<p class=title>Pink Title</p>
6. HOW to apply CSS
Internal stylesheet
External stylesheet
Inline stylesheet