Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XHTML or HTML, CSS1 or CSS2 ? 1

Status
Not open for further replies.

Antonimo

Technical User
Jun 26, 2003
86
0
0
SE
In the past I built a few websites where the only concern was that they worked!

I am now creating a brand new site and I am concerned with making it standards compliant and accessible.

I wonder if anybody reading this forum would like to outline the reasons (or against) using XHTML and CSS Level 2 as opposed to HTML 4.01 (or any other versions).

The website will still need to work in most browsers...

Perhaps this topic will be become a useful source of reference for the pros and cons of designing according to different DOCTYPEs.
 

You always have to weigh up using newer (and therefore theoretically superior) standards against the number of browsers that support those standards. After all, if no browsers supported CSS Version X, or (X)HTML Version Y, you'd not really want to use it.

If I can use the term "most browsers" to refer to "IE 6, FF 1, NN 7, Opera 7" on Windows, and "Safari, FF" on the Mac, then we can safely say that most browsers support most day-to-day layout elements of CSS 2, and pretty much all of XHTML (xhtml MIME type debate aside).

Using XHTML 1 or 1.1 over HTML 4 doesn't given you much benefit in terms of the HTML that your page comprises of, but it does give a far more consistent look to your code, and forces you to start making your code more compliant with the direction the standards are likely to head down (all lowercase tags, for example).

I would definately advise making your code XHTML compliant, strict if you can. Always test in multiple browsers - at very least, IE, FF, and Opera - unless you are writing for a specific browser (on an intranet, for example).

I'm sure I've not covered everything you want to know, and Im sure that other people will be able to add to, afree with, and disagree with some, all, or none or what I've said ;o). That aside, it should give you some idea of what I would call a good direction to go down (XHTML, CSS2).

Hope this helps,
Dan


The answers you get are only as good as the information you give!

 
Thanks for the reply Dan,

In my "explorations" of this topic around the web, it would seem that aiming to achieve good practice through the use of XHTML must be the best way to go.

Unless I discover a good reason not to use it, I shall go with standards compliant XHTML and CSS2
 
Incidentally, probably the single most important piece of advice I can offer is:

Have a complete and valid DOCTYPE declaration at the top of your page.

This will look something like this:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]

Pages will look different without it across browsers (more so than with it). It will put IE in "standards-compliant" mode, so some code will behave differently.

Start with that, and you'll also be able to validate your XHTML at and your CSS at
Hope this helps,
Dan


The answers you get are only as good as the information you give!
 
but keep in mind that there are different types of doctypes each allowing different things
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top