Solved

Background Image align in Firefox vs IE

Posted on 2007-12-06
4
578 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

689 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