Hi,
I'm setting up some PHP pages and I'm having a problem where my php include file is not rendering an external stylesheet.
I have ...
index.php in a root folder, this calls on a header area include("topHeader.php");
and I have the directory structure
images, styles and includes
inside the includes folder, I have topHeader.php
When I call the include in index.php, the content shows up fine, but the CSS is not being rendered. Now I have a stylesheet being linked from the index.php page, in the head.
So what am I missing when using css with an include file?
Thanks
Using external stylesheets with includes
Moderator: General Moderators
Re: Using external stylesheets with includes
Are you calling the css file BEFORE the include?
Re: Using external stylesheets with includes
Yes, I am calling the stylesheet in the head tags of the main page that's calling the include. Then in the body I have the include. So the stylesheet should be rendering before the include gets picked up.
Re: Using external stylesheets with includes
Ok. let's say you have three files:
style.css
index.php
include.php
On index.php, you reference the style sheet first. Then include.php.
My next question then is this. Do you have elements on index.php before and/or after the include that are rendering properly?
Also, is it possible you have the path to your css file wrong?
Post some code and I'll see what I can do. But probably not until this afternoon.
style.css
index.php
include.php
On index.php, you reference the style sheet first. Then include.php.
My next question then is this. Do you have elements on index.php before and/or after the include that are rendering properly?
Also, is it possible you have the path to your css file wrong?
Post some code and I'll see what I can do. But probably not until this afternoon.
Re: Using external stylesheets with includes
OK, not php related. I deleted and retyped the link to the css and it works now, which is odd, considering I had the same exact code calling the CSS.
Sorry for wasting your time, thanks for your help though.
Sorry for wasting your time, thanks for your help though.
Re: Using external stylesheets with includes
Nah, it wasn't a waste of time. I've had to do the same thing many times. SOMETHING was different.
Last night I spent two hours troubleshooting a jQuery form when it turns out I was just missing a pound sign. I guess that's how programming goes.
Last night I spent two hours troubleshooting a jQuery form when it turns out I was just missing a pound sign. I guess that's how programming goes.