#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    8
    Rep Power
    0

    Is there a hack for Safari 3 ??


    Hello,

    Is there a hack for Safari 3.
    I found this hack :
    @media screen and (-webkit-min-device-pixel-ratio:0)
    {
    #safari { display: block; }
    }

    The problem with this hack is that he is valid for all verison of Safari.
    My need is a hack only for Safari 3.

    Thank you in advance for your help.
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,124
    Rep Power
    4309
    Yeah, that one is for Safari 3+.

    Why do you need to create a special style for Safari 3 anyway? Perhaps we could suggest an alternative solution.
    Spreading knowledge, one newbie at a time.

    Learn CSS. | PHP includes | HTML Validator | CSS validator

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    8
    Rep Power
    0
    I used a javascript code that cab détecte the version of Safari and the I use the appropriate css.
    My colleague did not agree this And he suggested me to try another solution.
    I poste you the javascript code, it can be util:
    Code:
    <script type="text/javascript">
       if(window.devicePixelRatio){ // La propriété devicePixelRatio n'est supporté que par Safari (similaire à l'ancienne propriété document.all
           /*détection de Safari 3*/
           if (navigator.userAgent.charAt(navigator.userAgent.indexOf("Version/")+8) == "3"){
                document.write(' <style type="text/css">');
    	        document.write('#zone_commandes { position:relative;height: 79px;_height: 79px;height: 79px\9;background-color: #dedfe1;border-top: 2px solid #FFFFFF;margin-bottom: -20px; } ');
                document.write('.zone_tab_contener{background-color: #436BB1; font-family: verdana, arial, sans-serif; font-size: 11px; height: 43px; width: 100%; margin-top: -14px;} '); 
    		    document.write(' </style> '); 
          }
    
    	} 
    
    
    </script>
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2010
    Location
    Texas
    Posts
    167
    Rep Power
    59
    He was asking if you could post your stylesheet to see if we can make it work for all versions without needing a hack.

    Comments on this post

    • Kravvitz agrees
  8. #5
  9. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,124
    Rep Power
    4309
    Yes, perhaps I should have been more clear. Would you please show us an example page and a screenshot of how Safari 3 renders it incorrectly?

    P.S. Using document.all for browser detection as the comment mentions... *shudders* ... is very unreliable. If one wants to tell whether or not a browser is IE, one can use this:
    Code:
    var isMSIE=/*@cc_on!@*/false; // http://dean.edwards.name/weblog/2007/03/sniff/
    Spreading knowledge, one newbie at a time.

    Learn CSS. | PHP includes | HTML Validator | CSS validator

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo