Results 1 to 7 of 7

Thread: menu/button - image rollover to css text

  1. #1
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    97
    Thanks
    31
    Thanked 2 Times in 2 Posts

    Default menu/button - image rollover to css text

    Hi,

    I'm trying to simplify and cut down on images and so decided to see if possible to have an image that then rolls over to just css text. So I did this and the issue is that the text is showing up on top of the image.

    Also wonder if I can just define the color of all the buttons and the text that you will see when rolling over at only one place.

    CSS
    #menu-acuarele {
    display: block;
    width: 200px;
    height: 53px;
    background: url('menu-acuarele.jpg');
    }
    #menu-acuarele:hover {
    background: #ffffff; color: #e23c29;
    font: bold 0.8em;
    }

    HTML
    <td width="207" align="center"><a href="#" id="menu-acuarele">acuarele</a></td>

    THANKS!

  2. #2
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    97
    Thanks
    31
    Thanked 2 Times in 2 Posts

    Default

    I found this but it's actually a hybrid of image with text on top.
    http://articles.techrepublic.com.com...1-5345057.html
    What I want is an image that then goes away and only see text.

  3. The Following User Says Thank You to questions For This Useful Post:

    code_junky (08-03-2008)

  4. #3
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    If you are attempting to cut down on bandwidth, then the most logical solution would be to use CSS sprites. The general concept is that you have ONE image which consists of a whole lot of images spaced out evenly. You then use CSS positioning to maneuver that image into the area you want it to show up in and adjust the size accordingly. By doing this, you only cause ONE http request to the server. This will drastically reduce your bandwidth on a busy site.

    If you don't know how/don't have the time to make CSS sprites, there is a site which will automatically generate them for you. See below.

    http://spritegen.website-performance.org/
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  5. The Following 2 Users Say Thank You to TheJoshMan For This Useful Post:

    code_junky (08-03-2008),questions (08-03-2008)

  6. #4
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    You can also learn more about CSS sprites by reading this article by "A list apart"

    http://www.alistapart.com/articles/sprites
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  7. The Following 2 Users Say Thank You to TheJoshMan For This Useful Post:

    code_junky (08-03-2008),questions (08-03-2008)

  8. #5
    Join Date
    Jan 2008
    Location
    Los Angeles
    Posts
    97
    Thanks
    31
    Thanked 2 Times in 2 Posts

    Default

    Thanks. I'll look into that. But do you know if what I was asking for is possible. The reason for that is that I am going to be adding and subtracting buttons sporadically in time and they will be moved around for graphic purposes and so I'd like to keep each button still separate.

    THANKS!

  9. The Following User Says Thank You to questions For This Useful Post:

    code_junky (08-03-2008)

  10. #6
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    My first response would be to tell you that I really couldn't tell you... However, even though I'm not sure if this is possible, one thought seems to come to mind.

    Try creating a DIV which holds the text, give it a "z-index" which will be lower than the "z-index" of the button. Does that make sense?

    Basically in a sense, you'll just be covering up the text with a button.

    Then on the ":hover" state, change the "z-index" so that the button is lower than the DIV you created to hold the text.

    Not sure if it will work, but that's the first idea that comes to my mind.
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  11. The Following User Says Thank You to TheJoshMan For This Useful Post:

    code_junky (08-03-2008)

  12. #7
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    haha, disregard my previous post. Unless I'm missing something very simple, that idea is impossible. I just tested every possible method I could think of with no luck.

    If I come up with any ideas, I'll post it here.
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  13. The Following User Says Thank You to TheJoshMan For This Useful Post:

    code_junky (08-03-2008)

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
  •