View Full Version : Create an image rollover without access to the head section
thecritix
Jul 27, 2009, 07:43 AM
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
Cerebrus' Maw
Jul 27, 2009, 09:13 AM
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>
m3kilpat
Jul 27, 2009, 09:56 AM
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.
angelwatt
Jul 27, 2009, 10:49 AM
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,
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.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.