How to write styles for safari? Everything that I find on the Internet works on safari and chrome, or does not work at all.

Used:

[if lt Safari] <link rel="stylesheet" type="text/css" href="<?php //echo Yii::app()->request->baseUrl; ?>/css/safari.css" media="screen, projection" /> ![endif] body:first-of-type .class{} html:root*.class {} html*.class {} 

But nothing helps.

The main style itself is loaded like this.

 <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" /> 

It is worth noting that I spend the test on Safari under Windows. There is no possibility to use Mac)

  • He is already very old, not sure that it makes sense to test it at all. - Qwertiy
  • @ fori1ton how then to test ?? - Maxim Cherevatov

1 answer 1

  1. Forget about Safari under Windows. Modern cool safari on a poppy plow no worse than chrome. So in 99.9% of testing it is only necessary because under the poppyseed the fonts are rendered differently, and the texts are wider. Otherwise, if everything is fine in Chrome, then it will be good in Safari too.
  2. [if lt Safari] - this does not happen. Conditional Comments is only a feature of IE up to version 10. Other browsers generally put a bolt on it.
  3. In general, to test Safari, Mac is not required. You can just take an iPad / iPhone.
  • The problem is that everything is fine on Chrome, and the customer is testing for the iphone and he has a layout. - Maxim Cherevatov
  • one
    In Chrome Developer Tools, you can turn on mobile devices and see how the site looks on different devices. - zhenyab
  • Of course, there will be problems on the iPhone. But you can potestit. For example, in FF: menu -> development -> responsive design, or in Chrome there is also such a feature in the development panel. - IonDen
  • "No worse than chromium" - quite a controversial statement. Literally the other day I came across the fact that Safari 8 (the most common at the moment) series of CSS3 chips (transformations, animations, flexbox) only supports prefixes ( caniuse.com to help). Site checking in Safari without macos can be done using site checking services in different browsers. Most of them are paid, but many have free trial. - fori1ton
  • @ fori1ton, Prefixes cannot be attributed to problems. If you build a project using Grunt / Gulp, you always need to use plug-ins like autoprefixer and not bother about it at all. - IonDen