Jump to content
xisto Community
Sign in to follow this  
HTML_Guru

Upgrading Your Site! Move from HTML 4.01 to XHTML 1.0

Recommended Posts

I planned to post 3 different parts because of the length, but so there's no confusion, I'll just make one big tutorial all together ;) .

======================================

(A note to the moderators: Alright, I've got this down now, so please delete all of my other posts besides this one, and any posting credits as well; thanks!)

======================================

Now the tutorial:

 

Concerning those in the webmaster biz...

 

If you are an aspiring experienced webmaster, then you should know about some changes that would be optimum for your site. I'm talking about XHTML.

 

XHTML, or EXtensible Hypertext Markup Language, is looking to replace HTML. So, if you have been using HTML, and want to keep your site clean and

 

updated, you should look into updating your markup.

 

The W3C, or World Wide Web Consortium*, governs the internet - they act as a sort of security camera and monitor for it. They are also the ones responsible

 

for creating and updating the new markup languages. And while HTML 4.01 is still being used today, XHTML 1.0 has been set to as some point replace HTML.

 

XHTML comes from a mix of HTML and XML, which is a sort of language dealing with describing date, instead of displaying data, which is the purpose of

 

HTML. You combine the two... and you get a rather powerful, new, markup language. And while both are related, XHTML is a sort of change from the both.

 

They are a few things to do to ensure that you have correct XHTML markup in your website. I'll cover the basic necessities that you need to be XHTML updated:

 

DOCTYPE: You may have an HTML doctype, but if you want to be XHTML-valid, you will need an XHTML DTD. As you may know, there are three basic

 

different types of doctypes for HTML and XHTML: Strict, Frameset, and Transitional - strict being the most difficult to conform to, Frameset if you plan to use frames, and Transitional for a good balance. I would suggest Transitional, myself. Here is the doctype you will need to add above everything else in your

coding:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://forums.xisto.com/no_longer_exists/;

 

Copy and paste the above DocType Delcaration in your website, and now your site can at least be identified as an XHTML site.

 

ENCODING: If you want to validate your website with XHTML, you will now need to state your encoding for your website. Encoding is necessary to identify

 

the different chracaters and such throughout your site. While web browsers don't need that declarance by default, an XHTML-validated site will need it. The

 

most popular encoding types, from what I know, are:

 

UTF-8

ISO-8859-1

 

You don't need to know much more about the encoding besides that. Now, I'll show you the necessary way to input that into your website - the code is:

 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 

I used UTF-8, but you can use any unicode you like, just replace it with the unicode I have there - AND LEAVE THE REST EXACTLY AS IT IS!

 

So now, so far, your XHTML markup should look something like this:

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://forums.xisto.com/no_longer_exists/;

<html>

<head>

<title>(Type in your title)</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 

<body>

 

The whole of your website should all pretty much go here!

 

</body>

</html>

 

You're on your way now, but you still need a few more things to make sure that your site is "full XHTML", you now need to make sure of the following things:

 

1. All of your tags are in lowercase - make sure that all your html tags and otherwise are in lowercase otherwise it won't be accepted.

 

2. All of your elements need to close - either you need to have a start and end element, or you need to have an element much like this:

 

<blah />

 

For instance, imagine a line break code. Obvioiusly, you're not going to put another ending code for it, so instead, you do the above (minus the "blah", plus

the"br")

 

3. Besides the above, there are some other things that won't be accepted anymore in XHTML.

 

Once you have done that, you are pretty much all set. Also, realize this: this is not the full, complete step of of updating your site from HTML to XHTML.

If you want to be sure of the necessary steps, go to the W3C website or, to validate your site with XHTML, go to validator.w3.org.

 

For more information on conformance, validation and otherwise, go to the W3C.

---------------------------

*Consortium: a group or grouping of organizations or otherwise for some common purpose.

 

(This tutorial should not be used if you are a beginner. If you are just starting, refer to another tutorial.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.