Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Apr 2011
    Location
    Eatontown, NJ
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Conditional Comments for Firefox on Mac?

    I have coded for years n windows and have recently been forced to start coding on a MAC. FireFox for MAC and FireFox for Windows DO have differences when reading CSS.

    The problem I currently have that let me to the forum is the nav menu for 1 of our sites:
    Code:
    #nav li a { padding:10px 20px 6px 10px; }
    In ALL browsers on Windows and Mac the above is fine, but the menu is off by 1 pixel in FF for MAC and only works like the others if code is:
    Code:
    #nav li a { padding:9px 20px 6px 10px; }
    Still looking for Mac conditional CSS.

    And yes I have tried using W3 standards (padding-top, padding-right, etc...)

    Regards,

    Kevin W
    www.kevinw.me
    Last edited by VIPStephan; 04-12-2011 at 04:13 PM.

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    hi kevinorin, I ended up making my style.css into style.php,
    then I use

    PHP Code:
    $d detect();
    $b $d['browser'];
    $v $d['version'];
    $o $d['os'];
    function 
    detect(){
        
    $browser = array ("IE","OPERA","MOZILLA","NETSCAPE","FIREFOX","SAFARI");
        
    $os = array ("WIN","MAC");
        
    $info['browser'] = "OTHER";
        
    $info['os'] = "OTHER";
        foreach (
    $browser as $parent){
            
    $s strpos(strtoupper($_SERVER['HTTP_USER_AGENT']), $parent);
            
    $f $s strlen($parent);
            
    $version substr($_SERVER['HTTP_USER_AGENT'], $f5);
            
    $version preg_replace('/[^0-9,.]/','',$version);
            if (
    $s){
                
    $info['browser'] = $parent;
                
    $info['version'] = $version;
            }
        }
        foreach (
    $os as $val){
            if (
    eregi($val,strtoupper($_SERVER['HTTP_USER_AGENT']))) $info['os'] = $val;
        }
        return 
    $info;


    then in the file I add conditions, like;
    PHP Code:
    <? if ($b =="FIREFOX" && $os == "MAC"){ ?>
    and so on.


    I know that some people disagree, but I've run into issues like this a few times.
    works perfectly with FF on windows & linux, but then breaks on mac. strangeness...

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,706
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    Hang on, hang on! That’s stupid (if I may be this direct). There is absolutely no need to write a conditional for Firefox on different OSs. Either the design is too restrictive in that it doesn’t adapt to different circumtances and user customs or the code is bad.

    I could imagine that there are pixel rounding differences when the viewport is resized. If this can’t be overcome by a different approach to sizing (i. e. parent elements etc.) then give your design enough room to coope with a one pixel difference. Especially in the design above I don’t see any reason why a pixel would be a problem.

  • #4
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    i'm not interested in arguing. this is an old post. but like it or not, there are some rendering differences. I built the pages from ground up. works on every browser in all OS's except FF on mac.
    Last edited by angst; 04-12-2011 at 09:35 PM.

  • #5
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm having a problem with a page in Firefox - everything looks okay except for the background lining up. Its someone else's code that i'm modifying, and its a disaster to begin with, so I was just hoping it would somehow work out. Every time I breathe on it something goes wrong. This is the link www.manayunkselfstorage.com/request2.html
    Any advice would be so much appreciated!

  • #6
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by AOpie View Post
    I'm having a problem with a page in Firefox - everything looks okay except for the background lining up. Its someone else's code that i'm modifying, and its a disaster to begin with, so I was just hoping it would somehow work out. Every time I breathe on it something goes wrong. This is the link www.manayunkselfstorage.com/request2.html
    Any advice would be so much appreciated!
    when you have a problem is better to start a new thread instead of 'reuse' one closer to your problem because the probability to get an answer here is pretty low.
    as op page from this thread, your page have invalid markup and this is the main problem with the way how it look in different browsers.

    http://validator.w3.org/check?verbos...Frequest2.html

    try to validate first and then if you still have problems start a new thread.

    best regards


  •  

    Posting Permissions

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