Common tags include: div, p, a, img, table, span
They look like this:
<div> This is a div tag </div> <div> <p> this is a p tag in a div tag </p> </div>
And here's the html for ITP Camp
<div> (notice the /div below) </div> <img src="some_image.gif" />
<div><p>This is correct</p></div> <div><p>This is incorrect</div></p>
<ul> <li>Apples</li> <li>Oranges</li> <li>Pears</li> </ul> ul -> li table -> tbody -> tr -> td
<a href="http://itp.nyu.edu/camp2015/">Click here!</a> <img src="example_img.png" alt="This is alt text" />
By default, hyperlinks look like this. If I want to modify the style, I can do this:
<a href="http://itp.nyu.edu/camp2015/" style="color:red">Click here!</a>
Which looks like this:
Instead of inline styles:
<h1 style="font-family: helvetica; font-size: 22px;">These are called</h1> <p style="color: red; font-weight: bold;">... inline styles</p>
How about separating the styles from the content:
<h1>Much easier...</h1> <p>... to deal with</p> <style> h1 { font-family: helvetica; font-size: 22px; } p { color: red; font-weight: bold; } </style>
selector { property-name: value; property-name: value; property-name: value; }
Examples:
html, body, div, form, fieldset, legend, label { color: black; } #main_nav li { color: black; } div.bottom_container div.bottom_wrapper { color: black; } div.pagination a.previous_page, div.pagination a.next_page, div.pagination span.previous_page, div.pagination span.next_page { color: black; }
Rules:
Order of precedence:
Selector Type | Example | Points |
---|---|---|
ID | #main_nav | 100 |
Class | .previous_page | 10 |
Element | div | 1 |
Examples: