Jump to content

CSS and PHP includes


akomaz

Recommended Posts

What is the standard for using css styling within a php include script?  Say you have a main page that calls a php script from an include command...is it recommended to keep all css files linked from within the main page and have strictly php used in the script code, or is it of little consequence where the styling is linked from?  This is assuming the styling is only used for that particular portion of the page that is associated with the include content.

Link to comment
https://forums.phpfreaks.com/topic/191107-css-and-php-includes/
Share on other sites

It doesn't matter how you do it as long as the CSS is between your head tags. CSS and PHP are completely different things that do not interact with each other at all. CSS interacts with the output of a PHP script (if the script outputs (X)HTML). So it doesn't matter where the CSS is in your PHP, as long as the result is a properly formed HTML document, and to have a properly formed HTML document, you need to have the CSS between the head tags.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.