SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast DFS's Avatar
    Join Date
    Sep 2002
    Location
    The Wilds of Northern Maine
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS parsing hack for Moz only?

    Kay, I've got some strangeness with an absolutely positioned <div> being placed in the right vertical spot on Netscape/Mozilla. I can correct it, but then it goofs up Opera.

    Code:
     
    #link1 {
     display: block;
     width: 150px;
     position: absolute;
     top: 520px;
     right: 0px;
     margin: 0px;
     padding: 0px;
    }
    This works perfectly in IE and Opera, but it renders too high in Netscape. So I tried to correct it by adding
    Code:
     
    html>body #link1{
    top: 580px;
    }
    And then it works great in Netscape and IE... but now Opera reads the second one and places it too far down.

    Is there a way to pass the rule to Netscape only and have Opera ignore the "Netscape fix"?

    Does that even make sense?

  2. #2
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1) doctype = ?
    2) Which versions of IE, Mozilla & Opera?

  3. #3
    SitePoint Enthusiast DFS's Avatar
    Join Date
    Sep 2002
    Location
    The Wilds of Northern Maine
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry! XHTML 1.0 Strict
    IE6, Moz 1.3, Opera 7

    I figured out my problem with that particular issue chasing down where the extra pixels were coming from in Mozilla.

    But I'm still wondering is there any hack to pass the style to Mozilla without Opera 7 picking it up, since Opera reads the html>body div.yadayada hack

  4. #4
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think relying on "css hacks" and parsing bugs isn't the best idea (will only give you more work when the next version of IE/Mozilla/Opera requires a new type of hack)

    I.e. I agree with the title of this page
    http://www.alistapart.com/stories/tohell/

  5. #5
    SitePoint Enthusiast DFS's Avatar
    Join Date
    Sep 2002
    Location
    The Wilds of Northern Maine
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh I agree! By chasing down the extra padding that Netscape was picking up, and putting it into a different selector, I was able to fix my problem without resorting to a hack, then figured out that was the right way to go about it anyway (I was trying to treat the symptom not the actual problem at first).

    Still curious if there's an 'exclude Opera 7' hack.


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
  •