| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: Oct 2006
Posts: 12
|
php in css
could someone check my php code the file name is css.php PHP Code:
<link rel="stylesheet" type="text/css" href="style/css.php" /> the problem is, when im on the index.php, it doesnt show the above css |
|
|
|
|
|
#2 (permalink) |
|
Senior Member
Join Date: Dec 2006
Location: Switzerland
Posts: 350
|
why dont you simply use a css file ? I cant see why you would want to complicate things by creating css using php. I would simply add the following to your pages: <link rel="stylesheet" type="text/css" href="style/css.css" /> |
|
|
|
#4 (permalink) | |
|
Senior Member
|
Here's your problem: Quote:
Easiest solution I think would be to pass the basename to the css file via querystring. HTML Code:
Last edited by d3mcfadden : 23-06-2007 at 10:18. |
|
|
|
|
#5 (permalink) |
|
mingin dawg baitch
|
I'm not a PHP coder, but maybe doing things inline also helps. <?php if(basename($_SERVER['PHP_SELF'], '.php') == 'index') { ?> <style type="text/css"> #left { width: 140px; float: left; } #main { margin-left: 150px; } #container { width: 100%; float: right; margin-left: -140px; } </style> <?php } ?> |
|
![]() |