|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
OO CSS? Creating single CSS file and including with php on many pages
I have a single CSS file that I'm using all over the place on my website. When I edit the file, I have to copy it to each directory to make sure that each directory is using the same file.
I would like to have a php file in each directory that I can include with the same code in every file, that points to the CSS file in the root directory of the site. I tried putting this in the html of the page: Code:
<?php include('styleref.php'); ?>
Then put this in styleref.php: PHP Code:
But this didn't work. Any hints? |
|
#2
|
||||
|
||||
|
No need to have PHP do anything. Put your layout.css file in the document root and use the following:
Code:
<link rel="stylesheet" type="text/css" href="/layout.css" />
__________________
# Jeremy Explain your problem instead of asking how to do what you decided was the solution. |
|
#3
|
||||
|
||||
|
What would be considered the root of a website? The directory containing the files displayed when you go to "website.com"?
|
|
#4
|
||||
|
||||
|
Figured out the root. Appears it is the "htdocs" folder when running Apache.
Thanks Jeremy. |
|
#5
|
||||
|
||||
|
Quote:
Quote:
But for now, do what's working. |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > OO CSS? Creating single CSS file and including with php on many pages |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|