Results 1 to 10 of 10

Thread: little help styling anchor hover on anylinkcss?

  1. #1
    Join Date
    Jul 2010
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default little help styling anchor hover on anylinkcss?

    I'm using the anylinkcss script here
    http://www.dynamicdrive.com/dynamici...anylinkcss.htm

    I'm having trouble working out how to style the hover on the main anchor - mine is currently navy background when I hover over it, but I need to change it to grey

    Any help would be appreciated.

    This is what I'm trying, but failing with

    .anchorclass {
    background-colour:grey;
    }

  2. #2
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,920
    Thanks
    2
    Thanked 267 Times in 262 Posts

    Default

    Hi there daxtrajero,

    I see two errors in the code, one fatal the other a possible problem in some browsers.
    1. the English colour will not work in any browser. Use the American color.
    2. the English grey may work in many browsers. It is safer to use the American gray.

    coothead

  3. #3
    Join Date
    Jul 2010
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks will give it a try

  4. #4
    Join Date
    Jul 2010
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    still doesn't work - I can set the background-color on the link, but as soon as I hover over it (and the menu appears as it should) the link background-color changes and I can't see where I need to look to change it?

  5. #5
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,920
    Thanks
    2
    Thanked 267 Times in 262 Posts

    Default

    Hi there daxtrajero,

    if...
    Code:
    
    .anchorclass {
       your attributes
    } 
    
    ...refers to the a elements, then use this for the hover state...
    Code:
    
    .anchorclass:hover {
        background-color:gray;
     } 
    
    If not give us a link to the site or the full code and we will look into your problem further.

    coothead

  6. #6
    Join Date
    Jul 2010
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    thanks, I'll give it a whirl.

    I think there's something imposing itself on the css, after the anylinks section.

    I've just tried the example code from the anylinkss page on dynamicdrive and I can happily change the background hover colour, so it's something wierd going on in my code.

    Will look deeper.

  7. #7
    Join Date
    Jul 2010
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    coothead, I stand corrected. Just tried your code:

    .anchorclass:hover {
    background-color:gray;
    }

    instead of my rubbish code below....

    .anchorclass a:hover {
    background-color:gray;
    }

    and it works!

  8. #8
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,920
    Thanks
    2
    Thanked 267 Times in 262 Posts

    Default

    No problem, you're very welcome.

  9. #9
    Join Date
    Jul 2010
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    can someone tell me how I use this below? I've never seen two items together in inverted commas like this ?

    class="anchorclass myownclass"

  10. #10
    Join Date
    Jul 2010
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    all sorted - found an error in my code - all sorted now

    thanks everyone!

Bookmarks

Posting Permissions

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