<class home>

New html and Xhtml information

Please see http://www.w3.org for specifics

html 4 and Xhtml 1.0

XML is changing the way html works and now Xhtml a combination of XML (tags that an author can customize and create themselves) to make tracking of information and changes in information easier. Browsers now use Xhtml and CSS standards to control display of pages. The DOCTYPE tag tells the browser information about how you are creating your page. If no DOCTYPE tags are found, the browser assumes that the page is old fashioned and you can't take advatage of Xhtml.

Xhtml advantages:
1. ability to connect to databases
2. works well with style
3. easily updatable for future use

In order to be ready for future changes and so that our pages will be viewable in the future, we need to start doing things in a certain way and some new rules to live by apply below.



New Rules to live by:

1. Always declare the DOCTYPE tag in the beginning of your html page.
---html doesn't care, but Xhtml will.

2. Always declare the character encoding.
This will help browsers display your characters correctly on the page.
ex.
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1 / ">
</head>

3. Always close all tags. If a tag doesn't normally use a closing tag put in a space and a "/"
---html doesn't care about closing tags for some tags, but Xhtml will: tags to pay attention to: <p>,<br />,<img>
ex. <img src="mypic.jpg" />
ex. <br />

4. All tags should be in lowercase.
---html doesn't care, but Xhtml will.

5. All attribute values need quotes.
---html doesn't care, but Xhtml will.
ex. <img src="mypic.jpg" width="150" height="300" />

6. Don't omit values for attributes that have the same name as attributes. (rare usage)
---html doesn't care, but Xhtml will.
ex. <hr noshade="noshade">


New DOCTYPE information:

Types:

Strict: If you use no depricated tags you can use this

Transitional: Use if you use depricated tags

frameset: Use if your site uses frames


Ex. Strict
<!DOCTYPE html PUBLIC "-//W3C//DTD html 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">


Ex. Transitional
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Ex. Frameset
<!DOCTYPE html PUBLIC "-//W3C//DTD html 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">