This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.

More (X)HTML Tags



Here are some more (X)HTML tags. (Please feel free to edit, add to, or even correct the infomation in this doc.)

First of all, most of the tags we have learned so far are called "block level elements". This elements can contain "inline elements" or other block level elements. These elements only work in between the <body> </body> tags. 

<h1>(Heading 1),<h2>(Heading 2), etc. are block level elements.

The <p></p>(paragraph) tag is a block level element.

You will see why this is so important latter.

On to the new tags!

<a> This is the anchor tag and we use it create links. These links to external websites, other pages in your own website, or even to specific location within a page.

Tip: anchor tags are considered inline elements, and so for our (X)HTML to be valid it must be inside a block level element such as a <h1> or <p>.
The anchor tag may work in your browser without being in a block level element, but it is not valid (X)HTML and is a bad habit to start.

Here is an example of an anchor tag:

<a href="http://www.google.com">Google</a>

href stands for Hypertext Reference. Notice also that the href goes completely into the opening anchor tag. What is in between the <a> and the </a> is what is displayed in the browser.

If you a referencing another (X)html document in the same directory as your current document then you simply need:

<a> href="about.html">About Us</a>

Go ahead and try these links in your basic (X)HTML page! (But remember to place them inside either a <p> or <h1> tag! We all want to be valid don't we?)
 

Task Discussion