Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to load a css for Safari only?

Tags:

html

css

safari

how can I load a css file only for Safari browser ? I usually use just this (without javascript)

<!--[if IE 8]>
  <link href="ie8.css" rel="stylesheet" type="text/css" />
<![endif]-->

for internet explorer 8. Thanks

like image 303
aneuryzm Avatar asked Feb 27 '23 19:02

aneuryzm


1 Answers

Real simple bit of PHP. Going to be an alternative for ASP too:

<?php
    $browser = get_browser();
    if(strtolower($browser->browser) == 'safari') {
        echo '<link href="safari.css" rel="stylesheet" type="text/css" />';
    } 
?>
like image 187
theorise Avatar answered Mar 07 '23 00:03

theorise