RE: [PHP] Stylesheets
| From: | PHPBeginner.com | Date: | Sat, 17 Feb 2001 11:29:09 +0000 |
| Subject: | RE: [PHP] Stylesheets | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-40318@lists.php.net to get a copy of this message | ||
here, I loked it up for you,
This is a CSS file for PHPBeginner.com - DON'T LOSE IT!!! :
CSS file: css.php
---------------------------
<?
$ua = Array();
$ua['USER_AGENT'] = strtoupper(getenv(HTTP_USER_AGENT));
if(strstr($ua['USER_AGENT'], 'MSIE'))
$ua['browser'] = 'IE';
elseif(strstr($ua['USER_AGENT'], 'OPERA'))
$ua['browser'] = 'Opera';
elseif(strstr($ua['USER_AGENT'], 'NETSCAPE6'))
$ua['browser'] = 'N6';
elseif(strstr($ua['USER_AGENT'], 'MOZILLA/4.'))
$ua['browser'] = 'N4';
else
$ua['browser'] = 'other';
if(strstr($ua['USER_AGENT'], 'WIN'))
$ua['platform'] = 'Win';
elseif(strstr($ua['USER_AGENT'], 'MAC'))
$ua['platform'] = 'Mac';
else
$ua['platform'] = 'other';
?>
BODY, TH, CENTER, TD, OL, UL, LI, H1, H2, H3, H4 { font-family: verdana,
arial, helvetica, sans-serif; }
PRE, TT, CODE { font-family: courier, sans-serif; }
H1 { font-size: <?=$ua['browser'] == 'IE' ? '180' : '160'
?>%; }
H2 { font-size: <?=$ua['browser'] == 'IE' ? '140' : '130'
?>%; }
H3 { font-size: 115%; }
H4 { font-size: 100%; }
PRE, TT, CODE { font-size: 10px; }
BODY, TH, CENTER, TD, OL, UL { font-size: 12px; }
.TopMenu { font-size: 17px; }
.L1 { font-size: 13px; }
.SubMenu,.L2 { font-size: 11px; }
.x { font-size: 5px }
.TopMenu,.SubMenu,.L1 { font-weight: 900; }
.SubMenu { line-height: <?=$ua['browser'] == 'N4' ? '7' :
'13' ?>px; }
.TopMenu { margin-left: 5px; }
.SubMenu { margin-left: 12px; }
A { color: #7B8FD6;}
A:visited { color: #800080;}
A:hover { text-decoration: none;}
A.TopMenu { text-decoration: none; color: #FFFFFF; }
A.TopMenu:visited { text-decoration: none; color: #FFFFFF; }
A.TopMenu:hover { text-decoration: none; color: #FFFFFF; }
A.SubMenu { text-decoration: none; color: #FFFFFF; }
A.SubMenu:visited { text-decoration: none; color: #FFFFFF; }
A.SubMenu:hover { text-decoration: none; color: #FFFFFF; }
A.L1 { text-decoration: none; color: #7B8FD6; }
A.L1:visited { text-decoration: none; color: #7B8FD6; }
A.L1:hover { text-decoration: underline; color: #7B8FD6; }
A.L2 { text-decoration: none; color: #000000; }
A.L2:visited { text-decoration: none; color: #000000; }
A.L2:hover { text-decoration: underline; color: #000000; }
-----------------
This file is far not perfect, it does not yet detect all the browsers, and
the styles themselves are to play with.
But, it could be a good base for your development.
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
maxim@phpbeginner.com
www.phpbeginner.com
-----Original Message-----
From: PHPBeginner.com [mailto:php-general@phpbeginner.com]
Sent: Saturday, February 17, 2001 8:20 PM
To: Michael Hall; PHP List
Subject: RE: [PHP] Stylesheets
YES! YES! IT'S PHP!!!
</kidding>
Michael, PHP just writes for you some text based on certain conditions and
the data from db or whatever ...
That text can be used for anything like HTML, JavaScript, sending emails or
even write a whole C software (with an fopen of course... is that possible?
I think it could be)
Anyway my point is that the code is the same for you css. Whether Netscape
on RH6 reads it or not is not a PHP business... It just sent a code and that
is it.
Do what: make a function to detect the browser. Define which CSS are the
best for each.
and then:
$css = get_browser();
include("$css.css")
Having a whole bunch of different css files, including only the perfect
ones.
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
maxim@phpbeginner.com
www.phpbeginner.com
-----Original Message-----
From: Michael Hall [mailto:lists@mulga.com.au]
Sent: Saturday, February 17, 2001 6:26 PM
To: PHP List
Subject: [PHP] Stylesheets
I'm building a PHP application which uses stylesheets. Stylesheets seem to
be broken in a big way on my system - using Netscape 4 something on Red
Hat 6.1.
Is this Netscape or somehow something to do with PHP? Things work as
they're supposed to viewing the pages on a Windows/IE box.
Mick
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net