SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard
    Join Date
    Aug 2002
    Location
    N.Ireland
    Posts
    1,046
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with a hack

    Not sure if this is possible or not but I need to apply one style to IE5+ and another to Opera and Gecko based browsers.

    For IE I want to set margin-bottom: -75px and others padding-bottom: -75px

    Is this possible using some kind of css hack?

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,380
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Hi Darren,

    You can use the star selector for ie and all the rest get the basic styles.

    Or you can use the child selector for gecko/opera.

    Or do you want one for each?

    Code:
    * html #elementname {margin-bottom:-75px}/* for ie*/
    html>body #elementname {padding-bottom:-75px}
    or
    Code:
    #elementname {margin-bottom:0;padding-bottom:-75px}
    * html #elementname {margin-bottom:-75px;padding-bottom:0}/* for ie*/
    I'm wondering why you need it and perhaps theres another valid way to do this without hacks?

    Paul

  3. #3
    SitePoint Wizard
    Join Date
    Aug 2002
    Location
    N.Ireland
    Posts
    1,046
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's the headline replacement on that template you've been helping me with m8. Tis a long explanation, everything works but in Opera the text is showing on hover for the background images. If I set padding rather than margin to -75px Opera is ok with it.

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,380
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Ok - long as it works

  5. #5
    SitePoint Wizard
    Join Date
    Aug 2002
    Location
    N.Ireland
    Posts
    1,046
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does now ta


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
  •