Re: Excluding linked stylesheets on CSS validator?

2013/9/28 BriarMoon Design <design@briarmoon.ca>

>  Hi Jaime;
> As far as I am aware there is no option built in.
>
> However if you are using PHP you could do this:
> instead of
> <link href="style.css" rel="stylesheet" media="print" type="text/css" />
> do this:
> <?php
> //if W3C validator don't use stylesheet
> if (stristr($_SERVER["HTTP_USER_AGENT"],'w3c') === FALSE) {
>     echo '<link href="style.css" rel="stylesheet" media="print"
> type="text/css" />';
> }
> ?>
>
> or use a get req:
> <?php
> if (!isset($_GET["skipexternalcss"])) {
>     echo '<link href="style.css" rel="stylesheet" media="print"
> type="text/css" />';
> }
> ?>
>
> neither of those options are perfect and I prefer the second given your
> use case but both should work.
>

Thanks Nick,

This could do the trick if I were the author of the validated pages, but
I'm not, I can't modify them.

Anyway, don't worry, this mail was just to check if there was some option
to do that on the CSS validator, but I see there isn't one, so I'll work
around this in other ways.

Thanks!
Jaime

Received on Saturday, 28 September 2013 15:02:32 UTC