CSS and Firefox

Discussion in 'CSS' started by steveeyes, Nov 7, 2006.

  1. #1
    Hi all

    I have a problem in firefox that is frustrating me and I can't find the answer.

    I have a simple div tag to place some adsense code on a page. Here is the code:

    #ad { float: left; margin-right: 20px;}

    In I.E. the graphic (lady lying and leaning on her hand) spaces properly (20px) to the right of the adsense code.

    In firefox, the graphic does not move to the right. I tried padding and the same results.

    They say a picture is worth a thousand words. Here is the link to the site:

    http://www.filipinaeyes.com/indexAD.htm (scroll down to about the middle of the page).

    In I.E. it looks fine, in Firefox, not the case. Does anyone have a clue how I can move the graphic to the right by 20px when browsing with Firefox, like it looks for I.E.? It looks perfect in I.E. but I'm a firefox fan and hate that I can't get it to look like I want in firefox. Help please.

    Thanks
    Steve
     
    steveeyes, Nov 7, 2006 IP
  2. dp-user-1

    dp-user-1 Well-Known Member

    Messages:
    794
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    110
    #2
    
    padding-right: -20px !important;
    padding-right: 0px;
    
    Code (markup):
    "!important;" works only in FireFox, IE will simply ignore the line (I don't know about IE7).
     
    dp-user-1, Nov 7, 2006 IP
  3. steveeyes

    steveeyes Well-Known Member

    Messages:
    420
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    103
    #3
    Thanks, but that didn't change anything.
     
    steveeyes, Nov 7, 2006 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    Firefox is acting correctly. This is an artifact of IE's faulty float model. Your best bet would be to code the image as foreground content. I believe that would be more semantically correct, too.

    cheers,

    gary
     
    kk5st, Nov 7, 2006 IP
  5. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #5
    Add "margin-left: 140px;" for "pic2".
     
    SoKickIt, Nov 8, 2006 IP
  6. steveeyes

    steveeyes Well-Known Member

    Messages:
    420
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    103
    #6
    SoKickIt

    Why 140px?? That worked for firefox, but not I.E.?


    I'm guessing, but you used 140px because the adsense code is 120px wide -- I'm always trying to learn. But with 140px, it pushes the form and text under the adsense code in I.E. Even though I love firefox, I have to pay attention to IE because so many people use it.

    Is there any solution to get it to work correctly in both IE and Firefox? It looks perfect now in firefox. If I could only now get it to look the same in IE without messing it up in firefox, I'd be a happy webmaster.

    Any suggestions?

    http://www.filipinaeyes.com/indexAD.htm (scroll down to about the middle of the page)

    thanks

    p.s. I appreciate you guys help. I tired a few other forums and others didn't even respond.





    Thanks
     
    steveeyes, Nov 8, 2006 IP
  7. steveeyes

    steveeyes Well-Known Member

    Messages:
    420
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    103
    #7
    Update........I got it figured out. Thanks everyone for your support. Sometimes you just need input to try different things out.

    For anyone who is interested. The key was the 140px for pic2. After I had posted above, I went back in and got rid of my code padding and margin for float left and all fell into place.

    Thanks Again
    Steve
     
    steveeyes, Nov 8, 2006 IP