Howdy,
I have some browser issues that I want to get around using php in my stylesheet. I've been following the technique outlined here, http://www.stylegala.com/articles/no_more_css_hacks.htm. I put this line into my html_header.php file:
and renamed the stylesheet.css file so it isn't found. In the stylesheet.php file I dumped my stylesheet between these comments /* BEGIN CSS RENDERING */ and /* END CSS RENDERING */. But when I view the site no styles are being applied though the link is in the source.HTML Code:<link rel="stylesheet" type="text/css" href="includes/templates/my_template/css/stylesheet.php" />
Can anyone tell me if I'm missing something.
Here's the stylesheet.php file with cut down css to save scrolling, there's no php in the css as yet as I want to get it displaying first.
Thanks for any help, I'm stuck on this.HTML Code:<?php header("Content-type: text/css"); $d = detect(); $b = $d['browser']; $v = $d['version']; $o = $d['os']; function detect() { $browser = array ("IE","OPERA","MOZILLA","NETSCAPE","FIREFOX","SAFARI"); $os = array ("WIN","MAC","LINUX"); $info['browser'] = "OTHER"; $info['os'] = "OTHER"; foreach ($browser as $parent) { $s = strpos(strtoupper($_SERVER['HTTP_USER_AGENT']), $parent); $f = $s + strlen($parent); $version = substr($_SERVER['HTTP_USER_AGENT'], $f, 5); $version = preg_replace('/[^0-9,.]/','',$version); if ($s) { $info['browser'] = $parent; $info['version'] = $version; } } foreach ($os as $val) { if (eregi($val,strtoupper($_SERVER['HTTP_USER_AGENT']))) $info['os'] = $val; } return $info; } ?> <?php if ($b != "OTHER" && $o != "OTHER" && $v >= 5) { ?> /* BEGIN CSS RENDERING */ ...my css with no php currently /* END CSS RENDERING */ <?php } ?>![]()



