OliveStreet
05-13-2011, 09:36 PM
Hello all,
I'm trying to get an image to show up behind text in my main nav menu. The links are text, and on hover, the links change color and I would like to have an image show up behing the text as a background image. The trouble is, only part of the image is showing up on hover. I've tried everything I know, which admittedly isn't much. I have been trying to search out this answer, but I don't think I'm using the correct search parameters because I keep coming with sites showing images using all images, which isn't exactly what I want. Any help would be greatly appreciated.
Here's how I would like the hovers to work:
http://www.sustsolutions.com/helpImages/correct.png
Here's what's happening:
http://www.sustsolutions.com/helpImages/incorrect.png
Here's my code thus far:
* {margin: 0; padding: 0:}
.group:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; }
.group { display: inline-block; clear: both; }
/* start commented backslash hack \*/ * html .group { height: 1%; } .group { display: block; } /* close commented backslash hack */
body {background:url(images/sustBG.jpg); background-repeat:repeat-x; background-color:#660000; font: 14px/1.4 Arial sans-serif; color:#660000}
#wrapper {width: 1044px; margin: 0 auto;}
#mainContent {position:relative; width: 1044px; margin-top:25px; background:#fff;}
#header {position:relative; padding:20px 20px;}
#logo {width:300px; float:left;}
#logo p {margin-left:-9999px;}
#mainNav {width:700px; margin-top:40px; float:right;}
#mainNav ul {margin-right:3px; margin-bottom:2px; list-style:none; font-size:1.3em;}
#mainNav li {display:inline-block; width:101px; height:42px; text-align:center; }
#mainNav li a {color: #660000; text-decoration:none; width:101px; height:42px;}
#mainNav li a:hover {color: #cc3333; text-decoration:none; width:101px; height:42px; background-image: url(images/nav-button.png);}
I'm trying to get an image to show up behind text in my main nav menu. The links are text, and on hover, the links change color and I would like to have an image show up behing the text as a background image. The trouble is, only part of the image is showing up on hover. I've tried everything I know, which admittedly isn't much. I have been trying to search out this answer, but I don't think I'm using the correct search parameters because I keep coming with sites showing images using all images, which isn't exactly what I want. Any help would be greatly appreciated.
Here's how I would like the hovers to work:
http://www.sustsolutions.com/helpImages/correct.png
Here's what's happening:
http://www.sustsolutions.com/helpImages/incorrect.png
Here's my code thus far:
* {margin: 0; padding: 0:}
.group:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; }
.group { display: inline-block; clear: both; }
/* start commented backslash hack \*/ * html .group { height: 1%; } .group { display: block; } /* close commented backslash hack */
body {background:url(images/sustBG.jpg); background-repeat:repeat-x; background-color:#660000; font: 14px/1.4 Arial sans-serif; color:#660000}
#wrapper {width: 1044px; margin: 0 auto;}
#mainContent {position:relative; width: 1044px; margin-top:25px; background:#fff;}
#header {position:relative; padding:20px 20px;}
#logo {width:300px; float:left;}
#logo p {margin-left:-9999px;}
#mainNav {width:700px; margin-top:40px; float:right;}
#mainNav ul {margin-right:3px; margin-bottom:2px; list-style:none; font-size:1.3em;}
#mainNav li {display:inline-block; width:101px; height:42px; text-align:center; }
#mainNav li a {color: #660000; text-decoration:none; width:101px; height:42px;}
#mainNav li a:hover {color: #cc3333; text-decoration:none; width:101px; height:42px; background-image: url(images/nav-button.png);}