Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    pseudo class question

    Hi, I'm having an issue getting pseudo classes to work in IE. I'm sure my syntax is wrong. It works in FF but the background image just dissappears in IE. How do you use pseudo classes with <a> elements that have a class or id? Any help is appreciated!

    <div id="navy">
    <a class="left" href="work.html">Work</a>
    <a class="right"href="life.html">Life</a>
    <a class="bottom" href="home.html">Home</a>
    </div>

    a.left:hover {
    background:url(images/colorleft.gif);
    color:white;
    text-decoration:none;
    }

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,606
    Thanks
    6
    Thanked 997 Times in 970 Posts
    That’s correct actually. Can we see the whole CSS and HTML please as there could be hundreds of reasons why it may not work.

    For a start make sure you write the pseudo classes in the correct order:

    Code:
    :link {…}
    :visited {…}
    :hover {…}
    :active {…}
    :focus {…}
    The last ones – I’m not 100% sure – can be interchanged, I believe but :hover needs to be after :link and/or :visited.

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,589
    Thanks
    0
    Thanked 644 Times in 634 Posts
    focus needs to come after visited and before hover. A field with the focus may or may not be active and may or may not have the mouse hovering over it.

    Code:
    :link {…}
    :visited {…}
    :focus {…}
    :hover {…}
    :active {…}
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,606
    Thanks
    6
    Thanked 997 Times in 970 Posts
    Sorry. That shows how barely I’m using both together.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •