Log in

View Full Version : Linking to css file in include file



highandwild
05-22-2015, 09:10 AM
I would like to link to an external css file from with a php file that is included in another file.

The main file is generic and has a header where css links are placed and the include file is a custom file
and determined by conditions found by querying a database.

Also - Can I include css in the include file without linking to an external css file?

Thanks in anticipation.

Beverleyh
05-22-2015, 10:13 AM
All of this doesn't really mean much without seeing the files, but here are a few suggestions.


I would like to link to an external css file from with a php file that is included in another file.
You'd probably do this via a PHP echo;
echo '<link rel="stylesheet" href="/path/to/styles.css" />';


Can I include css in the include file without linking to an external css file?
Again, you'd probably do this via a PHP echo;
echo '<style>';
echo 'selector { property: value; }';
echo '</style>';


If you need more help, please provide a zip of the files you're using.