|
From: Spiggy T. <th...@me...> - 2001-03-29 01:59:29
|
i have adopted the 'smart' stylesheet from geeklog. i include it like a
normal stylesheet. the php code checks for the browser/os and determines the
fontsizes.
function find($component)
global $HTTP_USER_AGENT;
$result = stristr($HTTP_USER_AGENT,$component);
return $result;
}
if (find('Win') && (find('MSIE 4') || find('MSIE 5'))) {
$font_medium='medium';
$font_small='small';
$font_smaller='x-small';
$font_smallest='xx-small';
} else if (find('Win')) {
$font_medium='large';
$font_small='medium';
$font_smaller='small';
$font_smallest='x-small';
} else if (find('Mac')){
$font_medium='x-large';
$font_small='large';
$font_smaller='medium';
$font_smallest='small';
} else {
$font_medium='large';
$font_small='medium';
$font_smaller='small';
$font_smallest='x-small';
}
<style TYPE="text/css">
<!--
BODY,TD { color: black; font-size: <?php echo $font_smaller; ?>;
font-family: verdana, arial, sans-serif }
H1 { color: black; font-size: <?php echo $font_medium; ?>; font-weight:
bold; font-family: verdana, arial, sans-serif }
H2 { color: black; font-size: <?php echo $font_small; ?>; font-weight:
bold; font-family: verdana, arial, sans-serif }
etc...
-->
</style>
this could be easily expanded to cover more vars
|