Forum Moderators: open

Message Too Old, No Replies

Validation and Work-Arounds

Do you have to choose? Is it really an issue?

         

Horse Feathers

12:15 pm on Jan 19, 2005 (gmt 0)

10+ Year Member



From a previous thread [webmasterworld.com]:

BlobFisk wrote:

One thing about your workaround is that the align property is deprecated and will not validate...

(Since this spawns a new debate, it deserves a new topic.)


Neither will leftmargin, topmargin, etc, although I understand from other threads (example [webmasterworld.com]) that you have to use these when Opera doesn't apply margin-left off your CSS.

So, is it more important to validate your pages or allow less-than-standard code to "fix" browser bugs? What layout options should you not consider to make sure you avoid validation problems?

tedster

3:57 pm on Jan 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've never been a slave to a perfect validator score. If I need some non-standard code to get cross-browser performance, then I will use it INTENTIONALLY - and keep the issue in mind until I can find a standards-based workaround.

This only makes sense, as far as I'm concerned. My audience is first and foremost the human beings who visit, and not the ideal of W3C validation.

But the word 'intentionally' is the key. I'm not ever going to return to the days of casually thrown together tag soup. And for the most part, I code for strict HTML, and not transitional. This also helps the many bugs that are intentonally preserved in quirks mode.

I would rather rethink the layout than go with non-standard mark-up, but sometimes that option is not immediately available, or at least not practical, when working with an already operational website.

TheDoctor

4:17 pm on Jan 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Isn't a bit like learning the saxophone?

When you start, you miss the note, you lose the rhythm, etc. Then you get good, and you hit every note perfectly, keep a strict rhythm, etc. And then you get really good - and you miss the notes and break the rhythm. But you miss note and break rhythm exactly how you mean to, not by accident.

And writing valid HTML is sort of the same. :)

encyclo

4:55 pm on Jan 19, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For the precise issue mentioned in the first post about
leftmargin
and
topmargin
, to set the margins to zero on the
body
element in Opera you simply need to use padding rather than margin in the CSS. The only time you would need those two attributes now is if you need Netscape 4/IE4 compatibility.

A better example might be the

autocomplete
attribute for
form
and
input
tags: it is a non-standard attribute, but widely supported cross-browser, and cannot be replaced by a standardized attribute. I am quite happy to use this when required even if it won't validate.

Even if you prefer (as I do) to use markup conforming to a strict doctype as much as possible, I would definitely recommend against attempting workarounds to replace deprecated elements and attributes which still exist in the transitional specification and for which the CSS replacements are absent or suffer from browser implementation problems. It has got to a stage that using a transitional doctype is frowned upon - a situation which is ridiculous.

So, in short, you should use valid markup as much as possible, but including deprecated markup where required, and even resort to non-standard attributes if necessary. However, you should always avoid improper nesting and other malformed markup which may break in unknown ways in future user agents.