Results 1 to 9 of 9

Thread: IE 7.0 specific CSS tags

  1. #1
    Join Date
    Jan 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default IE 7.0 specific CSS tags

    I am looking for a way to write IE 7.0 specific CSS tags.

    I have some tags in my CSS file that are redefined specifically for IE 6.0 using the following syntax:

    * html #mainmenu { padding-top: 32px;}

    The problem is, several of these CSS issues have been resolved in IE 7.0 (as well as there being new CSS issues) so I'd like an IE 7.0 equivalent of the * html syntax in order to overwrite this tag for IE 7.0.

    Any ideas would be very much appreciated.

    Thanks.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Hacks for IE have been unnecessary for a while. Use conditional comments instead:
    Code:
    <!--[if IE lt 7]>
      <style type="text/css">
        #mainmenu {
          padding-top: 32px;
        }
      </style>
    <![endif]-->
    <!--[if IE 7]>
      <style type="text/css">
        #mainmenu {
          /* IE7-specific stuff. */
        }
      </style>
    <![endif]-->
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jan 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the quick reply. This works great. The only thing is, it doesn't work in vBulletin.

    Do you know a way around this?

    Thanks again.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    What do you mean by not working? And, in vBulletin how? Embedded in the page? Does vBulletin mangle it somehow?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Jan 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    When I add the IE7 specific code to the "headerinclude" section of the vBulletin style, it completely ignores it. It simply has no effect.

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Page?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Jan 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Unfortunately I cannot show the site yet. Are you aware of any issues when of having IE 7 specific tags in vBulletin?

    Thanks again for your help.

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I have no idea if this will help but, if vBull is mangling it, this might:

    Code:
    <!--[if gte IE 7]>
    <style type="text/css">
    /*<![CDATA[*/
    
    styles go here
    
    /*]]>*/
    </style>
    <![endif]-->
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Jan 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your help. I eventually found the way to do this. vBulletin has conditions which you can use like this:

    <if condition="is_browser('ie', '7')">
    <style type="text/css">
    #mymenu { padding-top: 10px;}
    </style>
    </if>


    This solved the problem nicely

Bookmarks

Posting Permissions

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