/    Sign up×
Community /Pin to ProfileBookmark

Code validation?

I heard it’s important for your web page code to validate. I was having some problems with a few of my pages. I am writing xhtml 1.0 trad./CSS. I noticed that most pages on the net <u>DONT</u> validate even some that place #1 in google? Is it important? How important is it. My page looks good in every browser I check it in.

to post a comment
Full-stack Developer

2 Comments(s)

Copy linkTweet thisAlerts:
@KravvitzAug 03.2006 — If your XHTML doesn't validate and you try serving it with an [url=http://www.w3.org/2003/01/xhtml-mimetype/]XHTML mime-type[/url] all you get is an error when the XML parser runs into one.

HTML parsers are very forgiving, but when you have valid HTML (and XHTML served as text/html) the parsing can be done faster and you are more likely to have multiple browsers display pages the same.

We are well aware that not everyone knows or cares about validating their X/HTML and CSS code but we try to spread awareness when we can.

Why are you using XHTML 1.0 Transitional? What exactly are you transitioning from?

All new documents should be written in HTML 4.01 Strict or XHTML 1.0 Strict.

As to validating CSS... the warnings that the W3C's CSS Validator give are just that -- warnings about issues that might or might not be a problem, things that the stylesheet author should check up on when he/she is unsure if any of them may be causing a problem. In CSS you can use properties and values of properties that aren't part of the specs becuase [url=http://www.w3.org/TR/REC-CSS2/syndata.html#declaration]CSS parsers are required to ignore declarations that contain a property or value that they don't support.[/url] That doesn't mean that you should feel free to put whatever you want in your stylesheet. I tend to write code that's closer to what's in the CSS3 working drafts (CSS3 is modularized, so each module is somewhat independent of the others) than is in the CSS2 specs.

Which browsers, do you test your pages in, exactly?
Copy linkTweet thisAlerts:
@toicontienAug 03.2006 — The biggest benefit of validating your code is knowing you've avoided syntax errors. When things don't display properly, most times it's an error in your code, and validators are great at catching those. In many ways an HTML or CSS validator isn't a requirement for a project, rather it is a tool to write quality code. Only after the errors in your code are corrected can you start going after browser rendering bugs.

That's the biggest benefit of valid code. It's not really a life or death requirement. End users don't give a s:eek:t about valid code, they just want a web site that works. It just so happens that writing valid code gives you the best chance at making a working Web site.
×

Success!

Help @NS_Graphics spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...