1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need a quick help in CSS margining..

Discussion in 'CSS' started by jehzlau, Jan 20, 2008.

  1. #1
    Please check this site in IE7, and Firefox

    http://www.ramonbongrevillajr.com/

    as you can see, the top menu doesn't display in IE7, but it displays in firefox... this is the CSS in the top Menu:

    .topmenu {
    	text-align:right;
    	float: right;
    	margin-top: 37px;
    }
    Code (markup):
    If i set the margin top to 20, the top menu can now be seen in IE7, but it was placed so high in FF.

    How can I put a condition, or maybe just do the trick in CSS that If the browser is IE7, the margin-top will be 20px, and if FF, the margin-top will be 37px..

    need help CSS gurus.. :(
     
    jehzlau, Jan 20, 2008 IP
  2. nicangeli

    nicangeli Peon

    Messages:
    828
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You know the site doesn't work in IE6, IE7 or opera?

    Anyway, I know this won't help this time, but you may wish to consider using a "reset" stylesheet when building sites in the future, something like the following will help reduce the errors you are now facing.

    CSS:
    
    *
    {
    padding: 0;
    margin: 0;
    }
    
    Code (markup):
    Also, have you tried validating your html and css?
     
    nicangeli, Jan 20, 2008 IP
  3. SoKickIt

    SoKickIt Active Member

    Messages:
    305
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    70
    #3
    Add this

    .header form {
     margin: 0;
    }
    Code (markup):
     
    SoKickIt, Jan 20, 2008 IP
  4. jehzlau

    jehzlau Active Member

    Messages:
    301
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #4
    Thanks nicangeli and SoKickIt :D Now it displays just fine :)

    @nicangeli - i haven't validated it yet.. :D thanks for the heads up :D
     
    jehzlau, Jan 20, 2008 IP
  5. CSSDevMonkey

    CSSDevMonkey Peon

    Messages:
    44
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Also, do you know how to use IE's conditional comments, which allow you to provide code specifically for versions of IE you declare with the conditional comment.

    IE Conditional Comments
     
    CSSDevMonkey, Jan 20, 2008 IP
  6. jehzlau

    jehzlau Active Member

    Messages:
    301
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #6
    Oooooooh.. i don't know about it.. thanks CSSDevMonkey :D
     
    jehzlau, Jan 20, 2008 IP
  7. ChaosFoo

    ChaosFoo Peon

    Messages:
    232
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #7

    Avoid using conditional statements wherever possible. It will cause you so many headaches down the road, it is not even worth it. Site maintenance is really difficult if you are using IE conditional statements.
     
    ChaosFoo, Jan 21, 2008 IP
  8. jehzlau

    jehzlau Active Member

    Messages:
    301
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    73
    #8

    Thanks for the heads up ChaosFoo :D
     
    jehzlau, Jan 21, 2008 IP