1
Gynther
Re: Polish your theme CSS files
  • 2003/5/31 14:25

  • Gynther

  • Just popping in

  • Posts: 8

  • Since: 2003/5/21


Making webpages look good cross-platform can be nightmare. I usually try and fix it with a little help from PHP and include a separate CSS file depending on which browser is used. This helps, me at least , to organize my stylesheets better. I make a version for each browser I wish to support and that does not comply with eachother and insert the following PHP code snippet:

if(strstr($HTTP_USER_AGENT, "Mozilla")){$user_agent = "Mozilla";}
if(strstr($HTTP_USER_AGENT, "Konqueror")){$user_agent = "Konqueror";}
if(strstr($HTTP_USER_AGENT, "IE")){$user_agent = "IE";}


and

echo("<link rel='stylesheet' type='text/css' href='stylesheets/stylesheet_".$user_agent.".css' />\n");

into the .php file. This way of course doesn't work if the user chooses to mask his/her browser as anotherone but that is more or less out of ones control. This also means that the CSS files have to be named like for instance "stylesheet_Mozilla".

Oh, and thanks sunsnapper for the tip about sizes. I was looking for that somewhere.




TopTop



Login

Who's Online

201 user(s) are online (124 user(s) are browsing Support Forums)


Members: 0


Guests: 201


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits