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

    Joined:
    Dec 11, 2006
    Location:
    West London, England
    #1
    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
     
  2. Cerebrus' Maw macrumors 6502

    Joined:
    Mar 9, 2008
    Location:
    Brisbane, Australia
    #2
    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>
     
  3. m3kilpat macrumors regular

    Joined:
    Jul 6, 2009
    #3
    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

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    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