SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2008
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    condition comment equivilent for firefox

    Hi All,

    Just wondering id anyone knows of a conditional comment equivalent for firefox? similar to <!--[if ie 7]> for IE.
    I have looked on this forum but only found 1 post from mid 2008..

    My problem is the css is working fine in FF 3.0.13 on the Mac but results in different padding on my nav menu in FF 3.0.11 on a PC

    Any help much appreciated!

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,186
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)
    Conditional comments are only recognized by IE
    If there is a difference between rendering in different Firefox/OS it will need to be addressed with CSS, maybe a global reset type of thing?

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2008
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply Mittineague,
    Could you explain what you mean by 'global reset'?

    eg: if i want the css to be this in ff 10.0.13:
    Code:
    #nav_sub a:link, #nav_sub a:visited {
    padding: 10px 26px 9px 27px;
    line-height:35px;
    }
    but this is ff 10.0.11:
    Code:
    #nav_sub a:link, #nav_sub a:visited {
    padding: 11px 24px 10px 25px;
    line-height:36px;
    }
    What do you suggest?

    Thanks!

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,826
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Set the padding yourself for whatever elements are picking up different default values.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,186
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)
    Because different browsers set different default values to certain elements (eg. body padding), some CSS authors recommend setting everything (global) back to "0" (reset) and starting from scratch. Way overkill IMHO. But if you can figure out where the offender is, it might be a good idea to do that one. Not so easy to figure out I'm afraid. What with "cascading" of inherited properties and all. But I have no doubt that someone in the CSS forum would be able to help much better than I could.

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,203
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    It seems strange to be fiddling with such small differences. It might be better to rethink your layout if such minor variations make a significant difference. Most people upgrade to the latest version of firefox anyway. If only it were the same for IE.

  7. #7
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Most people upgrade to the latest version of firefox anyway. If only it were the same for IE.
    You'd hope so, but the stats for my site for the last month (which deals with web development topics so you'd think the audience would be more likely to upgrade), show 8.2% still using FF 3.0.x which is still quite a high number.

    But I agree with your main point that if you're having to worry about such small details that maybe another approach is needed.

  8. #8
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    I agree, you should accept that small differences may occur between platforms and rendering engines, the main thing is that it doesn't severely impact your design. If the padding is just causing a minor offset in your design rather than collapsing anything, I would just leave it as a minor quirk and leave it as it is. Trying to make everything work the same across every browser is impossible, you should perhaps concentrate on more important aspects of your design.

  9. #9
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,186
    Mentioned
    191 Post(s)
    Tagged
    2 Thread(s)
    After seeing "minor" a few times I took a closer look at the example.
    I have to agree. Don't worry so much about getting things identical cross-browser. Indentical will never happen anyway, there will always be something out there you haven't tested for.

    How many site vsitors will be viewing the site in more than one browser simultaneously? How many are going to go back using a different browser than the previous visit and realize there's a pixel or two difference? I mean even subliminally?


Tags for this Thread

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
  •