Re: Excluding linked stylesheets on CSS validator?
Jaime Iniesta <[email protected]> Sat, 28 Sep 2013 17:02:05 +0200
| Newsgroups | gmane.org.w3c.validator.css |
|---|---|
| Message-ID | <CAKFFWV95gFNfa_rUJiJUaY0uuULdx=x6TVHLS+R-y3E-N5J4yA@mail.gmail.com> |
2013/9/28 BriarMoon Design <[email protected]> > 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