views:

83

answers:

4

What is the practical benefit to keep CSS 100% validated (not using any hacks), for client's projects.? even if there is no cross browser problem.

And what type of problem i can face in future if i do not maintain CSS validity 100%.

+1  A: 

Practical....hmm, I suppose that you can say to the client "it's 100% validated"? In practice if you're doing anything complex (e,g, opacity) it's extremely difficult to maintain 100% valid CSS, conditional stylesheets it a way to eliminate most of these cases, but not everything.

Do what works in this case, not what the validator tells you. That being said, don't ignore validation errors that are legitimate errors not there for a specific reason.

Nick Craver
but if we use css some css hacks then validator gives parsing error. can we ignore these errors
metal-gear-solid
@metal-gear-solid - If you've tested in all other browsers or it's a **well known** hack-around without side-effects, then yes. Aside from those cases, don't ignore them.
Nick Craver
metal-gear-solid
@metal-gear-solid - It looks like all your errors are resulting from * attributes, though other browsers are currently ignoring these, sometimes explicitly (they know they're IE intended), that *may* change. To be safe, break those `*attribute: value` settings into a [conditional stylesheet](http://css-tricks.com/how-to-create-an-ie-only-stylesheet/) loaded after this one only for IE, then you an be valid and safe, best of both.
Nick Craver
+1  A: 

The fact that a page looks correct with a current version of a browser doesn't guarantee that it will in a future version.

If you use non-valid CSS, you might be inadvertently relying on a bug in the rendering code, which, if it gets patched, could break your layout.

If you use valid CSS, however, any standards-compliant browser should display the page correctly, as long as it follows implements that version of the CSS standard.

Sebastian P.
for example yui reset is not valid http://yui.yahooapis.com/3.1.0/build/cssreset/reset.css
metal-gear-solid
This is correct. Browser rendering engines aren't static, they are continually changing, and almost exclusively they change to become more standards-compliant, which means that if you write valid CSS, browsers will be more likely to display it correctly in the future, but if you write non-valid CSS, they will be *less* likely to do so. That means more work for you in the future.
tloflin
@tloflin - but mostly we use hacks for old browsers and they will not get any new updates. like Microsoft is focusing on IE 8 and 9 not on IE 6 and 7
metal-gear-solid
@metal-gear-solid, we use hacks for old browsers which are continually being phased out, while new browsers that break those hacks are being introduced. Now obviously if you must include a certain feature--even for old browsers--that can only be done via a hack, you have to use the hack, but your question implied that not using the hack was possible.
tloflin
A: 

In short. If the validator complains about vendor specific/css3 properties like -webkit-border-radius ignore it. Anything else you should fix.

Javier Parra
A: 

The practical benefit to keep CSS 100% validated is also the fact that you can detect easier and much faster a mistake in your code.

For example, during website development, I always use a browser which shows me clearly when XHTML or CSS are invalid (green/red icons). It saved me a few hours of my life: sometimes, if I work with very basic editor, if I misspell something in CSS code, I notice it immediately when I see in the browser that CSS is nevermore valid.

Note: it also helps a lot to have 100% XHTML. Sometimes an invalid XHTML is caused by an error in code-behind.

MainMa