HTML and XHTML – or (X)HTML, when referring to both – are used to create the structure of a Web site; this is always the first thing to be coded. Following correct coding standards is the first step in accessible Web design.
HTML 4.0 vs. XHTML 1.0
All of the arguments and counterarguments boil down to two simple ideas: 1) What is needed for the site, and 2) The designer's personal preference.
Some say HTML allows the use of "sloppy" coding practices, which is true only if designers behave lazily and don't validate their code to catch their mistakes. As long as the designer is willing to code correctly and have his/her code validated, it won't be sloppy. Learning the correct coding practices in the first place makes HTML just as good a tool as XHTML.
Another potential problem is that, in order for browsers to understand XHTML, the code has to be sent from the server as HTML instead. Designers hoped browsers would eventually be able to read and understand XHTML; but this has not happened yet. Still, many proponents suggest that XHTML should be used anyway, so that when browsers are eventually able to read and understand XHTML, the sites will be ready for it and won't require major redesign or overhaul to update the markup.
In short, large companies, governments and other organizations that require large or extensive sites should probably be created with XHTML. This way, the site is designed with the ability to expand where needed quickly. Smaller companies and personal sites usually don't need XML technologies and can, therefore, be created with HTML. In either case, it is a good idea to learn how to use both (and understand their basic differences) in order to be able to easily switch between the two when needed.
It's like the difference between having a hammer and a nail gun – both will put a nail in a wall. It's easier to be sloppy with a hammer but if the person doing it pays attention and is careful, it doesn't need to be sloppy. Just because you have a new, "better" method doesn't mean the old one is useless or no longer needed. There will be times when a hammer is a better choice than a nail gun, and vice versa.
Please note that XHTML 1.1 is not a "better" version of XHTML 1.0 - they are two different things. XHTML 1.1 is only meant to be used in an XML setting with other XML variants such as MathML or SVG.
There is a new version of HTML currently in the beta stage, HTML 5, which should not be used by the average designer. It's not well supported yet and won't be for some time. Stick to using either HTML 4.01 or XHTML 1.0 as they are the current recommendations from the W3C.
Transitional was always meant to be used when transitioning from pre-HTML 4.0 markup to modern markup. Older, already-established sites could be switched to XHTML without the need for a complete redesign. When creating a brand new site from scratch, this DocType should never be used.
Frameset is used only for sites that use frames. Frames are deprecated by the World Wide Web Consortium (W3C) and should never be used unless absolutely necessary.
- Before creating the site, it's important to consider the text that will be included:
- Make sure the text will be easy to read by as wide an audience as possible.
- Don't use jargon or slang that could be confusing to the average reader.
- Be sure to break up the text into logical sections, with appropriate headers.
- Pages should contain different topics:
- Home page
- About page
- Contact page
- The layout should always be the same for every page on the site. For example:
- Header on top
- Main navigation links to the left
- Content to the right