i am using a backend server which is smarty which does not allow me to have multiple styles sheets and i have to only have 1 css file for all the html pages, also i cannot write <!-- IF lte IE6 <style type="text/css"> </style> end if --> where i can write exclusive code for ie 6 or 7 to make any adjustments to maintain browser consistancy, so i write these small ie fixes in the same style sheet i use for all the pages as #div{ margin: 0 0 0 10px; *margin: 0 0 0 9px; _margin: 0 0 0 8px; padding: 0 0 0 10px; *padding: 0 0 0 8px; _padding: 0 0 0 9px; } when i validate my css code from css validator website i get the following warnings ============================================ Parse Error *margin: 3px 0 0 0; Parse Error : 3px 0 0 0; Property _padding doesn't exist : 4px 0 0 30px Property _margin doesn't exist : 1px 0 0 0 ============================================ as i do not have an option to use another style sheet nor can i write <style></style> in my situation how can i go about writting code for ie 6 and 7 and sometimes even for firefox and at the same time not get the warnings. please advice. thanks
If you know what your code is doing and it isn't wrong, then you can ignore the warnings I guess, but if you really want to avoid them you can either make sure your code doesn't need the hacks in the first place, or put them in conditional comments as you suggested at the start of your post. These can go inside a single CSS file also, they don't just have to be used to link to multiple stylesheet.
Pretty much if you are having to dick with elements on something like margins or padding for each browser version, you are throwing 'silver bullet' hacks at the page instead of fixing the actual layout issues, as there is NO REASON to ever need to do that... Most likely you either don't have a doctype, aren't tripping haslayout, or aren't applying a double-margin fix... as to using a conditional, if you have to use one in the markup to apply a separate CSS file, you've got deeper issues since that ****otry is never necessary. Do you have an actual example of where you have to apply such changes to each browser? Perhaps we can show you how to write the same thing working cross browser without that asshattery.