Solved

Background Image align in Firefox vs IE

Posted on 2007-12-06
4
570 Views
Last Modified: 2007-12-06
Hi,

It's a very simple text based menu, but when a menu item is active, I want to display a little triangle under the text.

I have the following CSS, which works perfectly fine in IE but fails in Firefox. In firefox, the image leaves about 5px at the bottom as well.

Pleeeeeeease Help!


#navlist
{
	border: 0;
	margin: 0;
	padding: 0;
	list-style-type: none;
}
 
#navlist li
{
	width: 90px;
	height: 20px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	text-align: center;		
	text-decoration:none;
	display: block;
	float:left;
 	color: #999999;
	
	padding-top: 5px;
        /* For Testing ONLY */
	background-color:#0033FF;
}
 
#navlist a:link, #navlist a:visited
{
	color: #999999;
	text-decoration: none;
}
 
#navlist a:hover
{
	color: #99CCFF;
	text-decoration: none;
}
 
body#home a#homeActive,
body#products a#prodActive,
body#sizing a#sizeActive,
body#myAccount a#accActive,
body#about a#aboutActive,
body#contact a#contActive
{
	text-decoration: none;
	background-image:url(images/triangle.jpg);
	background-position:bottom;
	background-repeat:no-repeat;
	height: 20px;
 
}

Open in new window

0
Comment
Question by:jset_expert
  • 2
  • 2
4 Comments
 
LVL 29

Accepted Solution

by:
Göran Andersson earned 250 total points
ID: 20424572
As always, if the page renders differently in Firefox and IE, Firefox is correct...

If you don't put display:block on the links, they are inline elements. Inline elements doesn't have a specific size, so setting a height on them has no effect.

Except in IE, which applies the height to them anyway...
0
 
LVL 1

Author Comment

by:jset_expert
ID: 20424586
but I do have display: block
0
 
LVL 29

Expert Comment

by:Göran Andersson
ID: 20424619
You have display:block on the li element, but not on the a element. Unless you have more css somewhere else...
0
 
LVL 1

Author Comment

by:jset_expert
ID: 20424624
ooops sorry...my bad!

Thanks, that worked great!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question