Dan Williamson
26-12-2005, 03:20 AM
Hey guys.
Normally I write PHP tutorials, but recently i've come across websites who are still using all dirty unclean HTML so i'm here too write a tutorial on cleaning up your code and making it XHTML compatible.
Ok now people might say... Whats the difference between HTML and XHTML.
And i'd say:
There are a number of differences, all XHTML tags must be closed.
XHTML is formatted or something in XML too reduce browser problems. Which is good :)
Starting XHTML, now i'm assuming that all you Habboxilians know HTML ( HyperText Markup Language )
XHTML is basically a stricter cleaner HTML.
Now starting off.
You'll need a w3 approved XHTML Doctype.
There are three doctypes, there are strict, transitional and Frameset
Strict
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Transitional
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Frameset
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
Now.
The harder thing which took me a bit too get used too and I still don't do this now. It's write your HTML format in lowercase letters I tent too use capitals for a lot.
DOCTYPE HERE
<html>
<head>
<title>my XHTML document</title>
</head>
<body>
<p>Some random text</p>
</body>
</html>
Thats a very standard and basic XHTML document.
See how it's all lowercase and nicely set out. You have too be very careful in XHTML when nesting things as well you cannot make the simplest mistake, this is how strict it is.
Some random snippets which might make your life a tad easier
<b>Bold Text</b>
Makes your text bold
<i>Italic Text</i>
Makes your text italic
>
<span style="text-decoration: underline;">The text that will be underlined here</span>
Now, this one may confuse you a bit. Valid XHTML has removed the old <u> tag and replaced it with a CSS tag which I personally and many would agree with me thing it's sooo better.
Even images have changed in XHTML no more silly short ones.
example:
<img src="pic.gif" style="width: 10px; height: 10px;" alt="pic.gif" />
And you can do all the other cool things, like link external style sheets etc.
So hope this has given you a quick insight into the world of XHTML, try using it for better websites.
- Dan
Normally I write PHP tutorials, but recently i've come across websites who are still using all dirty unclean HTML so i'm here too write a tutorial on cleaning up your code and making it XHTML compatible.
Ok now people might say... Whats the difference between HTML and XHTML.
And i'd say:
There are a number of differences, all XHTML tags must be closed.
XHTML is formatted or something in XML too reduce browser problems. Which is good :)
Starting XHTML, now i'm assuming that all you Habboxilians know HTML ( HyperText Markup Language )
XHTML is basically a stricter cleaner HTML.
Now starting off.
You'll need a w3 approved XHTML Doctype.
There are three doctypes, there are strict, transitional and Frameset
Strict
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Transitional
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Frameset
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
Now.
The harder thing which took me a bit too get used too and I still don't do this now. It's write your HTML format in lowercase letters I tent too use capitals for a lot.
DOCTYPE HERE
<html>
<head>
<title>my XHTML document</title>
</head>
<body>
<p>Some random text</p>
</body>
</html>
Thats a very standard and basic XHTML document.
See how it's all lowercase and nicely set out. You have too be very careful in XHTML when nesting things as well you cannot make the simplest mistake, this is how strict it is.
Some random snippets which might make your life a tad easier
<b>Bold Text</b>
Makes your text bold
<i>Italic Text</i>
Makes your text italic
>
<span style="text-decoration: underline;">The text that will be underlined here</span>
Now, this one may confuse you a bit. Valid XHTML has removed the old <u> tag and replaced it with a CSS tag which I personally and many would agree with me thing it's sooo better.
Even images have changed in XHTML no more silly short ones.
example:
<img src="pic.gif" style="width: 10px; height: 10px;" alt="pic.gif" />
And you can do all the other cool things, like link external style sheets etc.
So hope this has given you a quick insight into the world of XHTML, try using it for better websites.
- Dan