Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder lokeshshettyk's Avatar
    Join Date
    Aug 2008
    Location
    On the way to the moon!
    Posts
    157
    Thanks
    5
    Thanked 20 Times in 20 Posts

    CSS (IE/FF)top property problem

    Hi,
    Below is my css for a dropdown i created. everything works fine except for the top property. I want the "top" to be the same for IE 6 & 7 and "top: 0" for FF. But FF also takes 1.4em . Can someone help me with this please!
    Code:
    /* For IE 7 */
    html>body .postNav .shareDD {
    	top: 1.4em;
    }
    /* for IE 6 */
    * html .postNav .shareDD {
    	top: 1.4em;
    }
    
    /* for FF */
    .postNav .shareDD {
    	top: 0em;
    }

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    html>body .postNav .shareDD {
    top: 1.4em;
    }
    The above one is more specific than
    .postNav .shareDD {
    top: 0em;
    }
    and FF also recognise the child selector > (neglecting your command inside the comment ).
    Thus the first one would override the last in FF as per CSS specificity.
    Last edited by abduraooft; 11-13-2008 at 10:34 AM.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder lokeshshettyk's Avatar
    Join Date
    Aug 2008
    Location
    On the way to the moon!
    Posts
    157
    Thanks
    5
    Thanked 20 Times in 20 Posts
    Thanks! and I'm confused. What would be the css then to distinguish between IE6, 7 and FF for the below given segment?

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    You could use conditional comments to write some specific tags, but normally there won't be a case where we need to handle IE6 and IE7 separately for the top property. There might be some other issue with your code.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    Regular Coder lokeshshettyk's Avatar
    Join Date
    Aug 2008
    Location
    On the way to the moon!
    Posts
    157
    Thanks
    5
    Thanked 20 Times in 20 Posts
    That's not true in my scenario (at least with this). Thanks anyway


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •