CSS styling of PHP includes

netsider

Limp Gawd
Joined
Oct 12, 2004
Messages
466
This is probably a "newbie" question as I'm not exactly a pro in PHP, but I am learning steadily... but I couldn't seem to Google an answer to this.

As everyone who uses PHP knows, when you include something in PHP.. .the PHP tags are "turned off" when you include something.. which I also am aware of.

However, how is styling handled when you include something? I'm guessing it's handled differently because I can't seem to style anything that's autogenerated in an include (Like if an include prints out tables from a database, I can't seem to use CSS to style them with colors, etc). If I don't include the same exact code, everything works fine.

Is there a tutorial or page in the manual that I can read about this, but I'm just not seeing it? The section on includes doesn't say anything about CSS, or styling of the code in the incluide.

Currently, I have a PHP include which prints out the navigation links on a webpage. When I attempt to style the code, it applies it, but "behind" the included links/code. If people need to see what I'm talking about.. I can post a pic, but I'm sure you guys know what I'm saying.

Any help would be appreciated... as I've been kinda stuck on this for a few days now ;)
 
Your CSS has a problem or you have an extra or missing div tag.

Whatever is on your include will be put exactly as it is in the spot of your include(). The server then sees it as a part of the original page like it was copied and pasted in. What ever code is there will read your css file the same as any other code on the page.
 
You need to post some code or something. PHP sends HTML to the web server. Styling HTML sent by PHP is the same as styling static HTML. If that's not happening there's some bug or something you're not telling us. If this is being loaded in through AJAX/AJAJ or something that could be causing an issue if your CSS is dynamically applied.
 
Back
Top