Easy Web Site Design

HTML tutorial : Basic HTML Code

Home
Definitions & history
Why is it important?
Introduction to HTML
Basic HTML Code
HTML Tables
HTML Lists
HTML Forms
Standards: XHTML
Web graphics
Presentation - CSS
Enhancing the Web
Usability
Accessibility
Going live
Online payments
The Future: XML
Internet Glossary
On the Web

Suggested reading







More books on
Web Site Design

Let's look more closely at what may go inside the body section:

<BODY>
  <H1>This is a main header</H1>
  <H2>This is a second level header</H2>
  <P>Hello world!</P>
</BODY>

The <H1> and <H2> elements are headers. HTML offers up to six levels of headers (ie to <H6>). By default, browsers display each level of header progressively smaller - ie <H1> is the biggest, <H6> the smallest. In practice it's rare to use headers lower than <H3> or <H4>.

We've already met the <P> element. It's purpose is to treat enclosed content as a paragraph. By default, browsers will display some white space above and below the paragraph content.

Note that I say "by default" when talking about presentation. This is because it is possible to define exactly how browsers display particular elements by using style sheets.

The <BR> tag is used on its own (it does not have a closing tag), its purpose is to create a line break, ie what follows <BR> is displayed on a new line.

<STRONG> tags cause enclosed text to be displayed in bold type.

<EM> tags cause enclosed text to be displayed in italics.

Tags can be combined, eg <STRONG><EM>gives bold italics</EM></STRONG>. Just remember to close the tags in the reverse order to which you opened them, so the <EM> part is contained within <STRONG>.

back to top

One of the great strengths of the Web is its ability to jump from one page to another by means of hyperlinks. This is what the HTML code for a hyperlink looks like.

<A HREF="index.htm">Home</A>

Everything between the start and end tags will be displayed as a clickable hyperlink.

Like many HTML tags, the <A> tag contains an attribute, this is an additional piece of information inside the tag. In this case the HREF attribute tells the browser which page to open if the hyperlink is clicked.

Another attribute that can be provided within the <A> tag is TARGET. If this is set to _blank the linked page will open in a new window when the hyperlink is clicked, eg

<A HREF="new.htm" TARGET="_blank">New page</A>

The <IMG> tag is used to display images.

<IMG SRC="tree.jpg" HEIGHT="200" WIDTH="150" ALT="An old oak tree">

<IMG> has no end tag, but it does have a number of attributes. SRC indicates the location and file name of the image to be displayed.

More on Web graphics

HEIGHT and WIDTH specify the height and width the image is to be displayed at. They can be used to change the size of an image. If omitted, the image will be displayed at its original size. However, it is a good idea to include height and width attributes as they allow the browser to display the text for the entire page without having to wait for the images to load.

ALT is used to provide an alternate text description for the image. It is good practice to include the ALT attribute as it makes your Web site more accessible.

Want to learn more? See

W3Schools HTML Tutorial

W3C - Dave Raggett's Introduction to HTML

NCSA - A Beginner's Guide to HTML

HTML 4.01 Specification

USENET newsgroups:
alt.html
comp.infosystems.www.authoring.site-design
comp.infosystems.www.authoring.html
alt.macromedia.dreamweaver
macromedia.dreamweaver

back to top

More on HTML

© web.twinisles.com Questions? Comments? Contact info@twinisles.com