Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Internet Explorer and Hover CSS – Probably a really simple solution…

  • This topic is empty.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #36292
    pancakecakes
    Member

    Hello all.
    I hate to feel like I’m wasting people’s time with this, because I know I’m probably missing something really small, and really obvious, but it’s driving me INSANE.

    Basically, all I want is for some text to be one colour when standard, another colour when hovered over. I can get it to work fine straight away in Firefox and Chrome, but IE refuses to pay any attention to it.

    I’ve been trying to break it down, so here is my incredibly simple bit of code:




    content="text/html; charset=ISO-8859-1"
    http-equiv="content-type">

    type="text/css">
    body
    {background-color:green;}
    a1
    {
    color:white;
    }
    a1:hover
    {
    color:black;
    }




    Hello

    Like I said, works perfectly in FF and C, but not IE. What am I doing wrong?

    Thanks in advance! =D

    #95336
    TheDoc
    Member

    a1 isn’t a thing… Do you mean h1?

    #95337
    pancakecakes
    Member

    mmmmpossibly.
    However even if I change it to h1, the colour change rollover doesnt work in IE, but does in FF

    #95339
    TheDoc
    Member

    This will work in every single browser: http://jsfiddle.net/dHx8p/

    #95340
    pancakecakes
    Member

    Sorry be a right pain in the bum, but it’s still not working for me, I just copied your stuff straight into NVU and tested it again. Fine with FF, nothing with IE
    Screenshot

    #95341
    TheDoc
    Member

    It must have something to do with how you’ve formatted your < head> section. Try this:




    Test




    This is a Test




    #95342
    pancakecakes
    Member

    Nope =( I must be doing something wrong. I really don’t get why this won’t work for me. I’ve tried it IE v6, v6 and v8, none of them will run the hover css. Thank for your help though!

    #95343
    TheDoc
    Member

    You copied that code exactly? I just saved the code above in an html doc and it appeared fine in IE. There must be something that you aren’t telling me!

    #95344
    pancakecakes
    Member

    I’ve just tried saving your text into wordpad and saving that as a html, and it did work, which now leads me to believe the program I’m doing my coding in (NVU, was called Kompozer I think a few years back?) is obviously adding something in that is stopping it from working… Hmmm

    Thanks Doc

    #95345
    TheDoc
    Member

    Very interesting. When you do it through your program, try viewing the source to see what it’s doing to your code.

    #95410
    pancakecakes
    Member

    It was NVU, everytime I exported the script, it changed the doctype header and was buggering everything up!
    Thanks Doc

    How do you change this topic to Solved?

    #95413
    TheDoc
    Member

    No problem.

    You just need to go to the first post in the thread, edit it and click the ‘Mark as Solved’ box. I’ve done this one for you ;)

Viewing 12 posts - 1 through 12 (of 12 total)
  • The forum ‘CSS’ is closed to new topics and replies.