Solved

Background Image align in Firefox vs IE

Posted on 2007-12-06
4
558 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
Comment Utility
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
Comment Utility
but I do have display: block
0
 
LVL 29

Expert Comment

by:Göran Andersson
Comment Utility
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
Comment Utility
ooops sorry...my bad!

Thanks, that worked great!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now