”skip
Red, Green and Blue

XHTML Basics

XHTML Rules

Click here to go straight to tag code

XHTML Documents Must Have One Root Element

The entire code must be nested within the <html></html> root element


Basic Structure of the Page

The basic Code for a page is written as follows:
<html>
<head>

<title>The information within this tag appears at the top of the browser</title>

</head>

<body>The information that appears in the browser window goes here</body>
</html>


Writing the Code


We are just going to deal with what goes in the" body" of your page click here for information for your head tags.
  • Must use Lower-Case

  • All page code elements and attribute references must be in lower case.
    <BODY><./BODY> INCORRECT
    <body></body>CORRECT

    Must use Quotes For all Attributes

  • <span class=bluetext></span>INCORRECT
  • <span class="bluetext"></span>CORRECT

  • Open and Close tags Correctly

  • Tags open and close inside one another
  • <div><p></div></body>INCORRECT
  • <div><p></p></div></body>CORRECT

  • Nest tags Correctly

    Tags open and close inside one another
    <body><p><div></p></div></body>INCORRECT
    <body><div><p></p></div></body>CORRECT

  • All Text must placed in a block level tag


    Text cannot be placed directly in the body
    <body> this is my text</body> INCORRECT
    <body><p> this is my text</p></body> CORRECT

  • All Ampersand Charactors Must Use Their Entity Value


    Instead of writing & in the code, you need to write &amp;

  • Internal links should use an "id" not "name

    "
    In XHTML the "id" attribute has replaced the "name" attribute
    But for the time being it is probably best to use both the "name" and " id" in order for the code to be read correctly by older browsers. If you use an "id" for all elements it is no longer necessary to create an anchor we would just point the user towards a particular id. Example:
    <a href="#area">Area</a>
    <div id="area" name="area"></div>



  • Cannot use attribute minimization


    For html you were able to just place one word attributes in some tags
    For example noshade was written as noshade
    In xhtml this is how you are required to write it:
    noshade="noshade"

  • Must use alternative text for every image on the page

    The alt attribute must be included in every image. The alt attribute should descript the image and include any text that is on that image. This is also required by section 508
    <img src="tree.png" alt="trees in a field" />

  • ID


    An id should be assigned to every tag except breaks
    Each "id"must be unique within the page
    Each tag can only have one "id"
    The name of the "id" must start with an alphabetic letter or an underscore
    The "id" attribute has replaced the "name" atttribute.
    The "id" can be the target of a link.
    The "id" can be used to identify styles on a styles sheet
    IDs in the style sheet are identified by the # sign

  • Class


    Tags can also be assigned  a class.
    The same class can be more than once on a page
    Classes in the style sheet are identified by a period.

Tags


The following tags are just the basic tags for a web page. A more extensive list will be added later. I have not included any XHTML tags for fonts and styles etc. because the assumption is that you will be using a linked style sheet and not including the styles on the page.

   

Body


The body tags are placed around all of the information that you want to appear in the browser window.

 

<body> </body>

Div - Divide

Block Level
Will automatically force the text onto the next line.

Divs are used to divide text into blocks which in turn are suitable for positioning and floats

<div> </div>


Blockquote

Block Level
It also indents the text on both sides.


<blockquote></blockquote>

Header tags

 

Block level
Will automatically force the text onto the next line. Defines text sizes from largest h1 to smallest h6.

Sizes and style can be customized in css.

These tags should be used for titles and sub titles

They are required for Section 508 and also aid in making a web page easier to read.

<h1> </h1>

Paragraph

Block Level
Will force the text onto the next line and there will be a space between the two lines

<p></p>

Span

Inline
Allows you to change the style of some text while still keeping it within the same line .

<span></span>

Strong

Inline
Creates bold text as the default. Style can be customized in css

<strong></strong>

Em

Inline
Create italic text
Style can be customized in css

<em></em>

Break

This is a self contained tag therefore you also need to include the closing slash
There is a gap between the "r" and the "/".

<br />

None Breaking Space


Not encased in a tag

Creates one space between letters. You should only use a few in any one place probably only about five. Some browsers appear to measure the width of a none breaking space differently than others.

&nbsp;

Horizontal Line

Creates a line across the web page
This is also a self contained tag therefore you need to enclude the slash so that it closes within itself. Don't forget the gap between the "r"and the "/"


<hr />

Image

Image tags are used for pngs, gifs and jpgs.

You are required to include an alt tag in which you place a description of the image. Including the alt tag is a rule of XHTML and also a requirement of section 508

The image tag is another self contained tag so once again you need to enclose the slash so that it closes within itself.

<img src="name.png" alt="description of image" />

Relative Link

Link to a page in the same directory (folder)

 

<a href="page.htm"> page </a>

 

Relative Link

Link to another to another page inside a directory

(folder)

 


<a href="folder/page.htm"> page </a>

Relative Link

Link to another to a page that is in a directory (folder)which is one level higher

<a href="...folder/page.htm"> page </a>

Absolute Link

Link to another site


<a href="http://site.com"> site </a>

Anchor

It is not longer necessary to create an anchor because theorically each tag on the page has an "id' therefore you can just link to specific "id"


<a name="top2" id="top"></a>

 

Link to an Anchor or ID on the same page

must include the #
Allows the user to jump to another part of the page that is indicated by an Anchor.

 

<a href="#top">name</a>

Link to an Anchor or ID on another page

 

 

<a href="page.htm#top">name</a>

 

Link to an email address

<a href="mailto:name@.com">name</a>



sites

sites sites
Kuler
Showcases designers and their specific color palette for individual projects and much much more.

Color Wheel
Distinguishes between web safe, web smart and other colors. Saves your choices.

Color Picker
Groups the colors that you select together>

Web Smart Palette
Lets you select colors using a cube and slider

sites

sites sites
Color

Basics Design: Color


At Amazon
Design Theory
Covers most of what you need know about color
www. color

www.color


At Amazon
Color Index One

Color Index


At Amazon
Over 1100 Color Combinations, CMYK and RGB Formulas, for Print and Web Media
Color Index Two

Color Index Two


At Amazon
Over 1500 New Color Combinations. For Print and Web Media. CMYK and RGB Formulas.

Videos

decoration only decoration only
Director and Animator: Melih Bilgil
From youTube: History of the Internet

1984 Apple releases its now famous advertisment.
View the 1984 Super Bowl advertisement
go to top of page go to footer siteMap