HTML Flashcards
Surrounds all HTML code?
< html > < / html >
Two sections of HTML?
< head> < /head>< body> < /body>
Headers
< h1>
< h2> etc.
paragraphs
< p> < /p>
line break
< br>
This does not have a close bracket thing
link to another page
<a>Text that you can click on</a>
image (with attributes)
< img src=”imgName.jpg”>< img src=”imgName.jpg” height = “300px” width = “200px” alt = “Picture” >
Add style WITHOUT css link
< p style=”color:red;font-size:60px;”>This is a red paragraph.< /p>
Add CSS within HTML page, ie not an external link
< style> body {background-color: powderblue;} h1 {color: blue;} p {color: red;} < /style>
Add CSS link
< link rel=”stylesheet” href=”styles.css”>
CSS code
h1 { color: blue; font-family: verdana; font-size: 300%; } p { color: red; font-family: courier; font-size: 160%; }
table
< table> < tr> < th>Band name< /th> < th>Toy< /th> < th>Name< /th> < /tr> < tr> < td>Weezer< /td> < td>XBOX 360< /td> < td>Alejandro< /td>
< tr>
< td>ABBA< /td>
< td>Balls< /td>
< td>Frederick< /td>< /tr>< /table>
unordered list
< ul>
< li>Coffee< /li>
< li>Tea< /li>
< li>Milk< /li>< /ul>
ordered list
< ol>
< li>Poffee< /li>
< li>Pea< /li>
< li>Pilk< /li>< /ol>
class attributes
.city { background-color: tomato; color: white; border: 2px solid black; margin: 20px; padding: 20px; }
Style of class determined in CSS, shown with the full stop
< div class=”city”>
< h2>London< /h2>
< p>London is the capital of England.< /p>< /div>
< div class=”city”>
< h2>Paris< /h2>
< p>Paris is the capital of France.< /p>< /div>
classes can be used multiple times