Create an image rollover without access to the head section

Discussion in 'Web Design and Development' started by thecritix, Jul 27, 2009.

  1. thecritix macrumors 6502

    Dec 11, 2006
    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.


  2. Cerebrus' Maw macrumors 6502

    Mar 9, 2008
    Brisbane, Australia
    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.


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

    <img for style to be applied />

  3. m3kilpat macrumors regular

    Jul 6, 2009
    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.
  4. angelwatt Moderator emeritus


    Aug 16, 2005
    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 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.

Share This Page