Introduction to HTML


Starting the page:
<html>
<head>
<title>Stuff (appears in window title bar)</title>
</head>
<body>
...page content...

Ending the page:
</body>
</html>

Tags that don’t need a close Meaning
<p> New paragraph (one line of space between)
<br> New line (no space between)
<hr> “Horizontal Rule” (just a line)

Tags that DO need a </close> Meaning
<h1>, <h2> , etc. Headings (big, bold text)
<center> Center text
<b> Bold
<u> Underline
<i>, <em> Italic (“emphasis”)
<blockquote> Indent both sides + space above and below

Tags with multiple parts Meaning
<ul>Un-ordered list:
<li>html
<li>web development
<li>web design
</ul>

Ordered list <ol>Building a web page:
<li>basic tags -- html, head, body
<li>add content
<li>save, upload, preview
</ol>

Entities
&lt; &gt; &nbsp; &amp; &quot; &copy;
Links

All links have three main parts:

1. Where do you want the link to take you? Put it between the quotes in the line below:
<a href=”http://wheretogo”>

2. What do you want to show in your page and be “clickable”? Put it next:
<a href=”http://wheretogo”>Click here!

3. Close the tag:
<a href=”http://wheretogo”>Click here!</a>

Absolute links:
<a href=”http://www.asite.com/page.html”>
<a href=”http://www.anothersite.com/directory/directory/blahblah/page.html”>

Relative links:
<a href=”somepage.html”> in this directory

<a href=”pagesfolder/somepage.html”> in a directory called “pagesfolder”
which is in this directory

<a href=”../somepage.html”> in the directory above this one

<a href=”../../../somepage.html”> in the directory above the directory above the directory above this one

Pictures

The picture tag has no /close part.

<img src=”name_of_picture.jpg” alt=”picture of whatever”>
<img src=”images/name_of_picture.gif”>
<img src=”http://www.blah.com/name_of_picture.png”> -- may not work!

Valid types: .jpg, .gif, sometimes .png -- these are the only 3 that work
Don’t forget the “alt=” attribute for handicapped people’s browsers.

Linking pictures

<a href=”page2.html”><img src=”page2_button.jpg”></a>


Next: Fonts, Tables