Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Dec 2005
    Posts
    57
    Member #
    12146
    Hi,

    Is there a way of using the hack

    <!--[if IE]>

    <![endif]-->

    within css code, or is there an alternative? to comply with recent versions of IE and Mozilla

  2.  

  3. #2
    Senior Member raspberryh's Avatar
    Join Date
    Aug 2004
    Location
    Erie, PA
    Posts
    882
    Member #
    7208
    Liked
    1 times
    you can use the *...

    * html ... {

    }

    ... only shows up in IE
    choosy developers choose gif!
    website | paintings | blog

  4. #3
    Member
    Join Date
    Dec 2005
    Posts
    57
    Member #
    12146
    so if i have a class like

    #button
    {
    width:80px;
    height:48px;
    float:left;
    background-image:url(..images/blank.gif);
    border: 1px solid blue;
    }

    how would you override this to display in IE with width 82px? Ive tried to implement it a few ways

    * html ... {

    }

  5. #4
    Senior Member karinne's Avatar
    Join Date
    Dec 2003
    Location
    Aylmer QC Canada
    Posts
    1,607
    Member #
    4335
    Liked
    8 times
    Code:
    #button
    {
    width:80px;
    height:48px;
    float:left;
    background-image:url(..images/blank.gif);
    border: 1px solid blue;
    }
    
    
    * html #button {
      width: 82px;
    }
    [a web design portfolio - Currently NOT AVAILABLE for work | web design | Re-coding | PSD-to-HTML]
    I'm also on: virb - facebook - twitter - flickr - del.icio.us

  6. #5
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    And by `only in IE', we mean IE <= 6. The * html hack no longer works in IE7, as I recall.

  7. #6
    Member
    Join Date
    Dec 2005
    Posts
    57
    Member #
    12146
    Thanks,

    I used

    html* #button {} in the end instead of * html #button in the end, its gets around around IE7

  8. #7
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Are you sure it doesn't also `get around' other browsers like Firefox? html * should be a valid selector...

  9. #8
    Member
    Join Date
    Dec 2005
    Posts
    57
    Member #
    12146
    i mean it works in IE7, IE6 and Firefox

  10. #9
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Interesting... So is the actual change applied in Firefox, too?

    Wait, now that I think of it, why would you need to change the width in IE7? As I recall, the box model hack has been unnecessary in recent versions of IE when they're in standards mode, no?


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:28 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com