|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
I'm using include to display a html file from a different directory to the current working directory. This page displays, but is missing all the CSS formating. I'm assuming this is because it can't find the CSS because it's in the different directory to the CWD. So, the easy way out is to move the CSS, but I've got heaps of these, and it makes it really messy. The PHP looks like this: include("xxx/index.htm"); the css is saved in the xxx folder. I'm open to any suggestions, ideas? Many thanks Matt |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Hi,
If you're linking to the style sheet in your HTML, then the path should be relative to the current URL, e.g.: <link rel="stylesheet" href="/xxx/xxx.css" type="text/css" /> The path can be absolute as in /home/xxx/xxx.css or relative as in xxx/ xxx.css. Regards, John Peters On Mar 8, 8:47 pm, p...@onsiteupdate.com wrote: > Hi, > > I'm using include to display a html file from a different directory to > the current working directory. > > This page displays, but is missing all the CSS formating. > > I'm assuming this is because it can't find the CSS because it's in the > different directory to the CWD. > > So, the easy way out is to move the CSS, but I've got heaps of these, > and it makes it really messy. > > The PHP looks like this: > > include("xxx/index.htm"); > > the css is saved in the xxx folder. > > I'm open to any suggestions, ideas? > > Many thanks > Matt |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
php@onsiteupdate.com wrote:
> Hi, > > I'm using include to display a html file from a different directory to > the current working directory. > > This page displays, but is missing all the CSS formating. > > I'm assuming this is because it can't find the CSS because it's in the > different directory to the CWD. > > So, the easy way out is to move the CSS, but I've got heaps of these, > and it makes it really messy. > > The PHP looks like this: > > include("xxx/index.htm"); > > the css is saved in the xxx folder. > > I'm open to any suggestions, ideas? > > Many thanks > Matt > > I think your problem has to do with the difference between relative and absolute URL references. Do some googling about those and I think you might get your answer. If you do not, and since this really has nothing to do with PHP, you can email off list and I can assist you with the problem. Thanks Jim Lucas |
|
![]() |
| Outils de la discussion | |
|
|