I have an PHP/HTML main page, in which I include different other PHP files (I include them within the body of the main page).
What if I want to include a CSS stylesheet into only ONE of the included file?
What if that included file is a PHP-only file? (that is, it doesn’t have those <head> tags, where the stylesheet reference is supposed to be)
What happens if I put “head” tags into a PHP file that is included in the body of the main page? I am wondering if putting head tags in the middle of the HTML body tags could cause problems at all, or at least with certain browsers.
Think of it this way, after all of you includes you still get one html file at the end of it. If you are including files in the body of your document, it should only contain tags that fit within the body, not html, head, title, body, etc. Your css file should be loaded in the of the main doc. Something like this
So after your includes the html should still be valid. you can check that here http://validator.w3.org/
EDIT:
You can included as many css files as you want anywhere in the document but the overall structure should still be as above. But try to consolidate your css files as much as possible. Every external file is one more request the browser has to make, and can slow the load time if you have a lot.