lithriel
07-26-2007, 06:29 PM
I am working on a website for myself and I have run into some funny spacing with some background images in Firefox.
The page is here:
http://www.ashleywalters.net/templates/business/businessasp/default.htm
The CSS is here:
http://www.ashleywalters.net/templates/business/businessasp/css/style.css
I am using a simple rollover effect using CSS, links, and background images to create icons that highlight. I am using a spacer image in the code with a link and class attached to get the desired effect. The spacer is the same size as the background icon images. However Firefox displays the background image halfway down the spacer image cutting the icon off. I have noticed this before on a least two other occasions while working on other websites and have used a hack. Instead of using a hack this time, I want to know why it is happening, and perhaps if there is a way to fix it.
The icons look fine in IE, go figure.
Here is a snippet of code from my website that creates the bar with the icons in it:
<div id="bar">
<a class="home" href="#"><img src="images/icon.gif" alt="Go to the Home Page" /></a>
<a class="contact" href="#"><img src="images/icon.gif" alt="Go to the Home Page" /></a>
<a class="support" href="#"><img src="images/icon.gif" alt="Go to the Home Page" /></a>
</div>
Here is the corresponding CSS:
a.home {background: url(../images/home.gif) no-repeat top left; width: 32px; height: 27px;}
a.contact {background: url(../images/contact.gif) no-repeat top left; width: 32px; height: 27px;}
a.support {background: url(../images/support.gif) no-repeat top left; width: 32px; height: 27px;}
a.home:hover {background: url(../images/home2.gif) no-repeat top left; width: 32px; height: 27px;}
a.contact:hover {background: url(../images/contact2.gif) no-repeat top left; width: 32px; height: 27px;}
a.support:hover {background: url(../images/support2.gif) no-repeat top left; width: 32px; height: 27px;}
Any ideas? Most likely the problem is deep within my CSS so I have provided the link to it above. Thanks for your help.
The page is here:
http://www.ashleywalters.net/templates/business/businessasp/default.htm
The CSS is here:
http://www.ashleywalters.net/templates/business/businessasp/css/style.css
I am using a simple rollover effect using CSS, links, and background images to create icons that highlight. I am using a spacer image in the code with a link and class attached to get the desired effect. The spacer is the same size as the background icon images. However Firefox displays the background image halfway down the spacer image cutting the icon off. I have noticed this before on a least two other occasions while working on other websites and have used a hack. Instead of using a hack this time, I want to know why it is happening, and perhaps if there is a way to fix it.
The icons look fine in IE, go figure.
Here is a snippet of code from my website that creates the bar with the icons in it:
<div id="bar">
<a class="home" href="#"><img src="images/icon.gif" alt="Go to the Home Page" /></a>
<a class="contact" href="#"><img src="images/icon.gif" alt="Go to the Home Page" /></a>
<a class="support" href="#"><img src="images/icon.gif" alt="Go to the Home Page" /></a>
</div>
Here is the corresponding CSS:
a.home {background: url(../images/home.gif) no-repeat top left; width: 32px; height: 27px;}
a.contact {background: url(../images/contact.gif) no-repeat top left; width: 32px; height: 27px;}
a.support {background: url(../images/support.gif) no-repeat top left; width: 32px; height: 27px;}
a.home:hover {background: url(../images/home2.gif) no-repeat top left; width: 32px; height: 27px;}
a.contact:hover {background: url(../images/contact2.gif) no-repeat top left; width: 32px; height: 27px;}
a.support:hover {background: url(../images/support2.gif) no-repeat top left; width: 32px; height: 27px;}
Any ideas? Most likely the problem is deep within my CSS so I have provided the link to it above. Thanks for your help.