Jump to content

list with background images as buttons


watts

Recommended Posts

I'm trying to create a group of navigation buttons using <ul> and background images.  The problem is that no matter what I set the height and width of the <li> or <ul> or <a> the image only shows directly behind the words and I don't get the full button. 

html:
[code]
  <div id="siteNav">
    <ul id="siteNavList">
      <li id="stock"><a href="http://www.skyartstock.com" title="stock photos">stock photos</a></li>
      <li id="prints"><a href="http://www.skyartprints.com" title="fine art prints">fine art prints</a></li>
      <li id="aj"><a href="http://www.arjenandjerrineverkaik.com" title="a & j verkaik">a & j verkaik</a></li>
    </ul>
  </div>
[/code]

css:
[code]
#siteNav {
margin: 100px 0px 0px 800px;
width: 97px;
}

#siteNavList {
        white-space:nowrap;
list-style-type:none;
width: 97px;
}

#siteNav ul li {
font-size: 10pt;
}

#siteNav ul li a {
width: 97px;
height: 27px;
color: #FFF;
text-decoration: none;
}

#siteNav ul li a:visited {
color: #C36AC9;
text-decoration: none;
width: 97px;
height: 27px;
}

#stock a {
background-image: url(../images/SS-002311.jpg);
background-repeat: no-repeat;
width: 97px;
height: 27px;
}

#prints a{
background-image: url(../images/SP-915525.jpg);
background-repeat: no-repeat;
width: 97px;
height: 27px;
}

#aj a {
background-image: url(../images/AJ-002335.jpg);
background-repeat: no-repeat;
width: 97px;
height: 27px;
}
[/code]

If anyone has any ideas I'd love to hear them.

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/28919-list-with-background-images-as-buttons/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.