We help IT Professionals succeed at work.

Firefox Won't Accept Pixels in place of top for background image position

walker6o9
walker6o9 asked
on
Medium Priority
187 Views
Last Modified: 2012-05-06
I'm using the code

#main-content .PDFrowD { width: 500px; float:left; display:inline; background: url(../img/SRreport_D.gif) no-repeat 20px right;}

to display a background image.  It works fine in Safari and IE, but in Firefox, it won't show the background image.  When I change 20px to top it works fine, although it's obviously not in the right spot.  Is there a way to adjust the position of the background image in firefox that would work?
Comment
Watch Question

David S.Consultant & Challenge Subduer
CERTIFIED EXPERT
Top Expert 2009

Commented:
Mixing image position keywords with numerical values is not allowed. Also when you specify two values the horizontal one should come first. Therefore change "20px right" to "100% 20px".
Web Developer
CERTIFIED EXPERT
Top Expert 2006
Commented:
I believe the horizontal position should come before the vertical, try this:

background: url(../img/SRreport_D.gif) no-repeat right 20px;

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
David S.Consultant & Challenge Subduer
CERTIFIED EXPERT
Top Expert 2009
Commented:
It seems that Steggs and I posted at the same time.

Also it turns out that mixing keywords with numerical values is now allowed in CSS2.1.  (It wasn't in CSS2.0.)

http://www.w3.org/TR/CSS2/colors.html#propdef-background-position
http://www.w3.org/TR/CSS21/colors.html#propdef-background-position
Mark StegglesWeb Developer
CERTIFIED EXPERT
Top Expert 2006

Commented:
Thanks for clearing that up Kravimir
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.