CpSc 130 Notes HTML Basics
HTML Basics
<html> <head> <title>First Page</title> </head> <body> <h1>Simple page</h1> <p>This is my first web page!</p> </body> </html>
Formatting
<html> <head> <title>Headings</title> </head> <body> <h1>This is an h1</h1> <h2>This is an h2</h2> <h3>This is an h3</h3> <h4>This is an h4</h4> <h5>This is an h5</h5> <h6>This is an h6</h6> </body> </html> |
This is an h1This is an h2This is an h3This is an h4This is an h5This is an h6 |
THIS IS IN A "P" tag
Links - The Anchor tag
The Anchor
<a href="aFileName"> clickableContent </a>
Pathnames
Details
Open this example in your own browser. | |
<p>You should have fun <a href="ch02ex02.html"> <img src="images/comedy_th.png" alt="laughing image"> </a> while learning HTML.</p> <p>Seriously, take another look at the <a href="ch1.html">chapter 1 notes</a> or maybe you wanted <a href="ch2.html">chapter 2</a>.</p> <p>Image provided by <a href="http://www.pdclipart.org"> Public Domain Clip Art</a>.</p> |
You should have fun while learning HTML. Seriously, take another look at the chapter 1 notes or maybe you wanted chapter 2. Image provided by Public Domain Clip Art. |
Note that the last link (anchor) is to an external web site. The first link (anchor) is the (inline) image itself. It links to the file below. |
|
<html> <head> <title>Are we having fun yet?</title> </head> <body> <h3>For real fun, click <a href="ch02ex02.html">here</a>. </h3> </body> </html> |
For real fun, click here. |
Why use relative path names?
Images
|
|
|
Lists
Lotsa ListsLists may be used in normal text or inside of tables. You have seen lots of them in these notes.
A list may be created manually using any character or even an image as a bullet
<br>£ Manual list <br>£ Ordered list <br>£ Unordered list <br>£ Definition list |
A list may be created manually using any character or even an image as a bullet
£ Manual list £ Ordered list £ Unordered list £ Definition list |
<br>* Manual list |
A list may be created manually using any character or even an image as a bullet
* Manual list * Ordered list * Unordered list * Definition list |
<br><img src="13_stars_us_flagTiny.gif"> Manual list <br><img src="13_stars_us_flagTiny.gif"> Ordered list |
A list may be created manually using any character or even an image as a bullet
Manual list Ordered list Unordered list Definition list |
||
A commonly seen list image:
<br><img src="missingImage.gif"> Manual list <br><img src="typo.gif"> Ordered list |
A commonly seen list image:
Manual list Ordered list Unordered list Definition list |
This is a default ordered list:
<ol> <li>Manual list</li> <li>Ordered list</li> <li>Unordered list</li> <li>Definition list</li> </ol> |
This is a default ordered list:
|
<ol type="A"> |
|
<ol type="a"> |
|
<ol type="I"> |
|
<ol type="i"> |
|
<ol type="i" start="3"> |
|
Sublists, auto numbered
<ol> <li>Manual list</li> <ol> <li>Special</li> <li>Keyboard</li> <li>Images</li> </ol> <li>Ordered list</li> </ol> |
Sublists, auto numbered
|
Sublists
<ol> <li>Manual list</li> <ol type="i"> <li>Special</li> <li>Keyboard</li> <li>Images</li> </ol> <li>Ordered list</li> </ol> |
Sublists
|
This is a default unordered list:
<ul> <li>Manual list</li> <li>Ordered list</li> <li>Unordered list</li> <li>Definition list</li> </ul> |
This is a default unordered list:
|
<ul type="circle"> |
|
<ul type="square"> |
|
<ul style="list-style-image: url(redball.gif)"> |
|
Sublists, auto "numbered"
<ul> <li>Manual list</li> <ul> <li>Special</li> <li>Keyboard</li> <li>Images</li> </ul> <li>Ordered list</li> </ul> |
Sublists, auto "numbered"
|
Sublists
<ul> <li>Manual list</li> <ul type="square"> <li>Special</li> <li>Keyboard</li> <li>Images</li> </ul> <li>Ordered list</li> </ul> |
Sublists
|
Tables