...

View Full Version : getting text under a rollover image with css



harlequeen
05-12-2007, 06:59 PM
Hi

Please help me with this, I can't seem to get it right. I did try using one image then only displaying half of it, but couldn't get it to work. So abandoned it for this.
I am trying to get some text under an image in a navbar. The images change on mouseover, but I cannot get the text underneath. Using dreamweaver everything looks OK, but after I uploaded it all went pear shaped.


#navbar li {
list-style: none;
display: inline;
height: 20px;
clear: both;
padding: 8px 20px 2px 20px;
}

#navbar img {

display: inline;


<div id="navbar">
<ul>
<!-- This is the rollover section for the navigation menu.-->
<li><a href="index.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('bottle','','images/glassesNew.gif',1)"><img src="images/bottle.gif" name="bottle" width="50" height="53" border="0">Home</a></li>
<li><a href="details.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('details','','images/glassesNew.gif',1)"><img src="images/bottle.gif" name="details" width="50" height="53" border="0"></a><a href="#">Details</a></li>
<li><a href="attendants.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('attendants','','images/glassesNew.gif',1)"><img src="images/bottle.gif" name="attendants" width="50" height="53" border="0"></a><a href="#">Attendants</a></li>
<li><a href="travel.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('travel','','images/glassesNew.gif',1)"><img src="images/bottle.gif" name="travel" width="50" height="53" border="0"></a><a href="#">Travel</a></li>
<li><a href="registry.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('registry','','images/glassesNew.gif',1)"><img src="images/bottle.gif" name="registry" width="50" height="53" border="0"></a><a href="#">Registry</a></li>
<li><a href="photos.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('photos','','images/glassesNew.gif',1)"><img src="images/bottle.gif" name="photos" width="50" height="53" border="0"></a><a href="#">Photos</a></li>
<li><a href="places.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('places','','images/glassesNew.gif',1)"><img src="images/bottle.gif" name="places" width="50" height="53" border="0"><a href="#">RSVP</a></li>
</ul>
</div>

When I initially checked the page in the browser when in Dreamweaver, it looked fine and my css #navbar img was set to 'block'. Yet when I uploaded the page the navbar images were one on top of the other. I changed my #navbar img to 'inline' and it does put them all along one line, but the images are next to the text, not above it.

Can anyone help please. Smiling
Here is the page url

http://www.our-perfect-day.co.uk/CC/index.htm
Thanks in advance.
Harlequeen


bringing colour to a dull world

Excavator
05-12-2007, 10:35 PM
#navbar {
height: 95px;
overflow: hidden;
}
#navbar ul {
}
#navbar li {
list-style: none;
text-decoration: none;
float: left;
height: 20px;
}
#navbar a {
text-decoration: none;
}

#navbar img {

display: inline;
}


<li><a href="index.htm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('bottle','','images/glassesNew.gif',1)"><img src="http://www.our-perfect-day.co.uk/CC/images/bottle.gif" name="bottle" border="0" height="53" width="50"> </br>Home</a></li>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum