This is a discussion on "CSS Validator issues" within the Web Page Design section. This forum, and the thread "CSS Validator issues are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
CSS Validator issues
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Hey, im trying to get my css and html validated, however I get 1 error.
I have a script that detects the browser, then either puts in a firefox/ie6/ie7 etc.. css file after the core css file. This then allows the site to look good in most browsers and works a treat. However when passing the URL thru the CSS validator online, it obviously doesnt detect a browser type, meaning I get only 1 css error because it can not access the missing browser css file. Does this make any sense? |
|
|
|
#2
|
|||
|
|||
|
Re: CSS Validator issues
By script you mean JS?
Use conditional comments instead
|
|
#3
|
|||
|
|||
|
Re: CSS Validator issues
Nope - the site is written in php, it detects the browser then "includes" the .css dependant on the browser.
However, when you run the page thru a validator, the validator is not actually using a browser so it then cant include the file - meaning I get 1 error message for not including the file. Would this still class as a css validation error which would need to be fixed to give me the green light? |
|
#4
|
|||
|
|||
|
Re: CSS Validator issues
Well ... JS or PHP ... whatever ... you should be using conditional comment anyways.
And quite frankly, the amount of CSS that's different from browser to browser should NOT be alot. If done well, only 1 stylesheet should suffice. |
|
#5
|
|||
|
|||
|
Re: CSS Validator issues
Many thanks for your reply.
So would the following work in just the one core.css file:
Where can I find more information of this? Thanks again. |
|
#6
|
|||
|
|||
|
Re: CSS Validator issues
See the link I posted above.
And ... you should need a if Firefox ... it's IE that's the problem ... not firefox Code your site properly and it will work in FF. |
|
#7
|
|||
|
|||
|
Re: CSS Validator issues
I always develop in firefox anyways, so ill just add the conditional comments to alter the IE parts.
Many thanks for your help. |
|
#8
|
|||
|
|||
|
Re: CSS Validator issues
Yep ... no problem
|
|
#9
|
|||
|
|||
|
Re: CSS Validator issues
Sorry - another quick question.
Is there of any way of putting this type of thing within a .css file. For example; I need to enter width:100%; if its IE but I dont need this at all if its firefox (hence the reason me picking up different css files using php) |
|
#10
|
|||
|
|||
|
Re: CSS Validator issues
Sorry - scrap that - its sorted now.
|
|
#11
|
|||
|
|||
|
Re: CSS Validator issues
Your HTML document should look something like this
|
|
#12
|
|||
|
|||
|
Re: CSS Validator issues
Note that conditional comments are a proprietary feature of IE (and a great one too!).
You cannot use conditional comments to target other browsers. Only IE. So this code is pointless:
|
![]() |
| Tags |
| css |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Closing tags in the validator | geyids | Web Page Design | 11 | Jan 14th, 2008 07:00 |
| Validator | jtyoungs | Web Page Design | 8 | Nov 8th, 2007 15:56 |
| W3 validator has a distinct dislike to my doctype | rubyfruit | Starting Out | 5 | Jul 4th, 2007 17:30 |
| Web2.0 Validator | spinal007 | Webforumz Cafe | 8 | May 29th, 2007 17:38 |
| W3C Validator | Maverick25r | Web Page Design | 14 | Oct 23rd, 2006 00:45 |