Jump to content

[SOLVED] Image spacing - I feel like this has to be easy...


Recommended Posts

I have a navigation bar made up of rollovers that when all pushed completely together, fit the screen perfectly. However there is added space automatically going between each rollover, and no matter what I change in the CSS, I cannot get rid of it...

 

Can someone help me out pleeeeease?

 

<div id="footer">
<a href="events.html" onmouseover="image1.src='images/eventsro.gif';"
onmouseout="image1.src='images/events.gif';">
<img name="image1" src="images/events.gif" border="0px"></a>

<a href="weddings.html" onmouseover="image2.src='images/weddingsro.gif';"
onmouseout="image2.src='images/weddings.gif';">
<img name="image2" src="images/weddings.gif" border="0px"></a>

<a href="corporate.html" onmouseover="image3.src='images/corporatero.gif';"
onmouseout="image3.src='images/corporate.gif';">
<img name="image3" src="images/corporate.gif" border="0px"></a>

<a href="gifts.html" onmouseover="image4.src='images/giftsro.gif';"
onmouseout="image4.src='images/gifts.gif';">
<img name="image4" src="images/gifts.gif" border="0px"></a>
</div>

 

CSS

#footer {
background: transparent;
margin: 0px;
padding: 0px;
word-spacing: normal;
letter-spacing: normal;
text-align: left;
white-space: nowrap;
width: 800px;
height: 25px;
float: left;
}

We need to see the CSS for the rollovers. The CSS you posted doesn't tell us anything.

 

oh, I am not doing the rollovers in css. I am using this at the beginning of my page to preload the images:

 

image1 = new Image();
image1.src = "images/eventsro.gif";

image2 = new Image();
image2.src = "images/weddingsro.gif";

image3 = new Image();
image3.src = "images/corporatero.gif";

image4 = new Image();
image4.src = "images/giftsro.gif";

 

Then I am just using what you see posted above.

Before you try fixing this problem, you should consider looking into css. There is absolutely no reason to be using javascript for something that css can do easily and more efficiently. (Rollovers).

 

Really? I remember looking into css rollovers and there was a mountain more of code than what I have now..

i'm no CSS guru, but i'll take a stab at it.  try adding the image and anchor elements directly into your definition:

 

#footer img, a
{
  margin: 0;
  padding: 0;
}

 

thanks but this made all my images everywhere scrunch way together and it made my nav stretch height

haha, ok I gave in and changed everything to CSS rollovers and that did fix it. I have to say though, I am not a fan of hoe you have to make the images for CSS rollovers. It's actually a real pain if you are working with transparent images and have to have exact measurements for top and bottom of the rollover image to shift....

 

Anyway....troubles are over (in this area) haha thanks a ton.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.