Forum Moderators: open
I use scripting to bring in header and footer files.
I keep page-specific styles on the page in <style></style>, instead of the master css file, to keep it free of clutter.
However, my docs are structured this way:
<include header>
<style>
</style>
<content>
</content>
<include footer>
Since in the header divs are started like this:
<div id="container">
<div id="content">
And in the footer divs are ended like this:
</div><!-- end content -->
</div><!-- end container-->
My page-specific styles always occur inside divs. What do I do?
Should I pay this warning any mind (Warning: <style> isn't allowed in <div> element)? Or should I keep doing what I've been doing.
head section, it may confuse spiders into thinking the following content is within the head rather than the body, which would have a negative influence on the page's spiderability. You should define your page styles as variables before including the header, then within the header include you can echo the page styles in the appropriate place.
I use gvim (editor) and all my pretty highlighting goes away when you make the styles variables.
I don't seem to get an error when I use <script></script> between <divs>. If I can use that, I don't understand why <style></style> is any different.
I can't, however think of any other option, short of splitting up my header include.