Lecture Notes: HTML Introduction

By Jack G. Zheng, CIS@Georgia State University

last updated 9/12/2006

 

HTML

Basic Facts

 

Basic HTML File Structure

<html>
<head>
<title> … </title>
</head>
<body>

</body>
</html>

 

HTML Tags and Examples (download)

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4><font color="blue">Heading 4</font></h4>
<h5>Heading 5</h5>

 

<!-- Some comments here; you don't see them in browser
CIS 3270 HTML example, by Jack G. Zheng 10/2/2005
-->

 

 

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5

 

<p>Font with different size and color</p>

<p>

<font size="2">Font</font>

<font size="4">Font</font>

<font color="red" size="6">Font</font>

</p>

<p>Font with different face</p>
<p><font size="7" face="Arial">Font</font>

<font size="7" face="Courier New">Font</font></p>

Font with different size and color

Font Font Font

Font with different face

Font Font

 

<p>A paragraph with <strong>bold</strong> and <em>italic</em> words</p>


<p align="center">A parapgrah aligned to the center</p>


<p>using breaks ...<br>
there will be no blank line<br>
between these lines of words</p>

A paragraph with bold and italic words

A parapgrah aligned to the center

using breaks ...
there will be no blank line
between these lines of words

 

<p><strong>Number list / ordered list </strong></p>

<ol>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
</ol>


<strong>Bullet list / unordered list </strong></p>
<ul>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
</ul>

 

<p><strong>A complex hierarchical list</strong></p>
<ul>

<li>unordered list 1

<ul>
<li>unordered sub list 1

<ul>
<li>further unordered sub list 1</li>
</ul>

</li>
<li>unordered sub list 2</li>
<li>unordered sub list 3</li>
</ul>

</li>

<li>unordered list 2</li>

</ul>

Number list / ordered list

  1. list item 1
  2. list item 2
  3. list item 3

Bullet list / unordered list

  • list item 1
  • list item 2
  • list item 3

A complex hierarchical list

  • unordered list 1
    • unordered sub list 1
      • further unordered sub list 1
    • unordered sub list 2
    • unordered sub list 3
  • unordered list 2

 

 

 

 

<p><a href="http://yahoo.com">A link to yahoo.com</a> (opened in the same window)</p>


<p><a href="http://yahoo.com" target="_blank">2. A link to yahoo.com (opened in a new window)</a></p>

 

<p>3.

<img src="http://www.gsu.edu/images/GlobalElements/head_logo.gif" alt="GSU" /> An image</p>

 


<p>4. <a href="http://www.gsu.edu">

<img src="http://www.gsu.edu/images/GlobalElements/head_logo.gif" alt="GSU" />

</a> An image with a link</p>

A link to yahoo.com (opened in the same window)

2. A link to yahoo.com (opened in a new window)

3. GSU An image

4. GSU An image with a link

 

<table width="150" >

<tr><td>cell 1,1</td> <td>cell 1,2</td></tr>

<tr><td>cell 2,1</td> <td>cell 2,2</td></tr>

</table>

 

<table width="150" border="1">
<tr>
<td colspan="2">cell 1</td>
</tr>
<tr> <td>cell 2,1</td> <td>cell 2,2</td> </tr>
</table>

 

cell 1,1 cell 1,2
cell 2,1 cell 2,2

 

cell 1
cell 2,1 cell 2,2

 

For more examples on table properties, cell merging and layout, see table1.htm and table2.htm

  • border, cellpadding, cellspacing, bordercolor
  • height, width, align, bgcolor (also applies to <td>)

 

Using HTML Editor

HTML editors

Why to use a WYSIWYG HTML editor?

Why can’t we depend on HTML editor?

 

Resources

W3 schools HTML tutorial

HTML history