Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

thecritix

macrumors 6502
Original poster
Dec 11, 2006
284
0
West London, England
Hi All,

I'm working within a CMS and can't access the head section of the code, for other reasons I can't get the web dev company who controls the CMS to add it.

So I wanted to know if there is a way of putting in an artificial head section into what is effectively the body or of creating an image rollover without a html head section.

Thanks

Nick
 
Hi All,

I'm working within a CMS and can't access the head section of the code, for other reasons I can't get the web dev company who controls the CMS to add it.

So I wanted to know if there is a way of putting in an artificial head section into what is effectively the body or of creating an image rollover without a html head section.

Thanks

Nick

When you say image rollover, you mean like the CSS hover attribute?

You can specify CSS content within the body of HTML, and I'm pretty sure it meets W3C standards also.

<html>
<head>
<title>title</title>
</head><
<body>

<style>
<!--Your CSS/rollover styles here-->
</style>

<img for style to be applied />

</body>
</html>
 
If you're thinking you need to include a css file in the head then I understand the problem. But you can just inline the css directly into the html in the body as stated above. What CMS are you using? Usually you can find the header file in the templates folder.
 
You can specify CSS content within the body of HTML, and I'm pretty sure it meets W3C standards also.

No, that's invalid HTML. The style tag is only allowed in the head tag, though some browsers will treat it as expected, but don't rely on it. Here's the error it will give you,
http://validator.w3.org/ said:
The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
The inline CSS would be fine though if that's what the OP is after. Though, the only tag that can go inside the head and body tag is the script tag.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.