What is the point of valid HTML?

nike_guy_man's picture

They have: 840 posts

Joined: Sep 2000

I am trying to figure out and reason why it is necessary to write properly formatted HTML. Why do we need to know the latest version?
Doesn't using work as well as using CSS and ??
Will users on Netscape 3.0 be able to see anything? If you use old HTML and write it for Netscape 3.0 or before, can't Netscape 6.0 still see it?
Personally, I think that if you are looking to make a website that is cross-browser compatible, wouldn't it make more sense to write it for the original browsers, and not just IE 6.0 and Netscape 6.0 (or is it 7.0?)

The only reason I can figure is it looks more 'professional' but I feel that it looks more professional if it works for everyone, not just the hippest and hottest web surfers.

What do you think?

Laughing out loud

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

There is a huge difference between markup of the content and design applied to the content.

CSS allows the separation of these two things. This allows the information to be used in a multitude of situations, first of all. Secondly, it reduces server demand, lightens the code, and makes revisions so much easier it's embarrassing that anyone ever thought the font tag was a good thing.

From the basic look, sure -- it's the same code. So why bother?

Well, look at this:

This text is white verdana, size 2.

You have to write that EVERY TIME you want the text to look like that.

This text is whatever you set .white to be.

Now you can add ANYTHING to the CSS, to change it. You can add borders to it, background colours, yank it out of the flow, change it on a whim, and never touch the markup again. For this reason, it's better not to use colours and such to differentiate classes for that reason, but people do.

Now, imagine having to add font tags for every single TD, every single P element. With CSS, you just define how they are treated. The judicious use of classes and ids makes the entire exercise much faster, and more future-proofed, at least as far as you can take that.

The content (marked up) is not changed, but the look, feel, and medium can change in a heartbeat.

As for Netscape 3, you are seriously doing people using those browsers a favour if you move all the design into the CSS. Also alternative browsers. Not only will the page be less bloated and less likely to crash their system (by a huge margin), you will be keeping the information available to them.

Using proper markup (headings, clear divs, not using endless nested tables for design) and having the design in the CSS is good for older browsers, who ignore what they don't understand. What they get is the information.

There is no reason to think that N4 will be ignored, either. You can still use tables for layout, up to XHTML 1.1, I think. And with the understanding of why Netscape doesn't understand CSS (it was banking on JSS and had to quickly adapt a translator when CSS got the nod), you can avoid the CSS that kills it by putting it into a more advanced stylesheet.

Stylesheets are designed to be cascading, meaning you can have multiple stylesheets for multiple media, and even within specialty pages on a site, you can add local or even inline (though inline is not recommended as a long-term solution, only for quick pages that are temporary in nature).

A lot of people hang up on the font tag, but the font tag is NOT your friend.

If you have endless instead of , you are hobbling your ability to update sites quickly, hobbling the accessibility of the content, and ignoring the value of the technology.

Yes, N7 will render your pages with tags. But that's not the issue, whether it renders or not (that's only a small part of it -- less bloated code makes it easy to make pages that work in more places), the issue is the content itself not having to be continually manipulated in order to be updated in future renditions of the site.

As for the "more professional" comment, well, yes, it's more professional to know what you're doing when you charge for it.

Busy's picture

He has: 6,151 posts

Joined: May 2001

Just for the record, font tags etc still validate to XHTML 1.0 Transitional specs and NS4.7 at least understands a lot of CSS (not so much layers etc). I don't believe tables will be phased out completely but use of CSS will become more common.

Using valid HTML (or better yet XHTML) will benifit you as web browsers and peoples personal habits advance. XHTML was created as HTML was getting to untidy (say thanks IE), XHTML allows for viewing of web pages, email etc on phones, hand held thingys etc without them hanging.

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

And if you code to standards you don't have to worry so much about cross-browser compatibility - every browser that supports the standards should show your page pretty much the same way.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.