Forums

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

Home Forums CSS Text on sprite button disappears on rollover

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #23352
    mikes
    Member

    I am using a sprite to create a rollover button that I can display text on. It works just fine when the page loads.When I mouse over the button, it changes the background position just like it should but the text disappears.

    Here is my css:

    Code:
    A.button, A.button:LINK, A.button:VISITED, A.button:ACTIVE, {
    float: left;
    display: block;
    background: transparent url(images/button.gif) no-repeat 0px 0px;
    overflow: hidden;
    height: 25px;
    width: 127px;
    margin-right: 8px;
    line-height: 29px;
    text-align: center;
    text-decoration: none;
    }
    A.button:HOVER {
    background-position: 0px -25px;
    }

    and I am calling it like this:

    Code:

    I could create an image with the text embedded in the image but I want a generic button that I can reuse.

    What am I missing here?

    #50389
    mikes
    Member

    I’m such a dork!

    By default I have:

    Code:
    A { color: 000000; }
    A:hover { color: ffffff; }

    Of course my black text on a white button was ‘disappearing’ on rollover.
    Geez, what a noob! :oops:

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