CpSc 130 : Introduction to Programming and Information Systems

CpSc 130 Notes HTML Basics


HTML Basics


Formatting


Links - The Anchor tag

The Anchor

<a href="aFileName"> clickableContent </a>

Pathnames

Details

Example

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 laughing image 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

  • Images are included using a special element that has an attribute specifying the image file
  • Since there is no "content" (only the image attribute), it does not have a closing tag
  • There are only a few of these tricky tags:

    <img src="ch01ex01.gif"
    alt="image of sample page"
    border="0">
    
  • View the example in your browser.
  • Why do we have alternate text? Screen readers and errors. See example.
image of sample page
  • I'm using that pesky <img> tag that has no content again (and, therefore, no closing tag)
    <img src="ch01ex02.gif"
    alt="image of sample page"
    border="0">
    
  • View the example in your browser.
image of sample page

Lists

Lotsa Lists

Lists may be used in normal text or inside of tables. You have seen lots of them in these notes.

Manual or Custom — Doing the work ourselves
A list may be created manually using any character or even an image as a bullet
<br>&pound; Manual list
<br>&pound; Ordered list
<br>&pound; Unordered list
<br>&pound; 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
Ordered Lists
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:
  1. Manual list
  2. Ordered list
  3. Unordered list
  4. Definition list
<ol type="A">
  1. Manual list
  2. Ordered list
  3. Unordered list
  4. Definition list
<ol type="a">
  1. Manual list
  2. Ordered list
  3. Unordered list
  4. Definition list
<ol type="I">
  1. Manual list
  2. Ordered list
  3. Unordered list
  4. Definition list
<ol type="i">
  1. Manual list
  2. Ordered list
  3. Unordered list
  4. Definition list
<ol type="i" start="3">
  1. Manual list
  2. Ordered list
  3. Unordered list
  4. Definition list
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
  1. Manual list
    1. Special
    2. Keyboard
    3. Images
  2. Ordered list
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
  1. Manual list
    1. Special
    2. Keyboard
    3. Images
  2. Ordered list
Unordered Lists
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:
  • Manual list
  • Ordered list
  • Unordered list
  • Definition list
<ul type="circle">
  • Manual list
  • Ordered list
  • Unordered list
  • Definition list
<ul type="square">
  • Manual list
  • Ordered list
  • Unordered list
  • Definition list
<ul style="list-style-image: url(redball.gif)">
  • Manual list
  • Ordered list
  • Unordered list
  • Definition list
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"
  • Manual list
    • Special
    • Keyboard
    • Images
  • Ordered list
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
  • Manual list
    • Special
    • Keyboard
    • Images
  • Ordered list

Tables