Dhruvang Gajjar
Dhruvang Gajjar

Reputation: 598

Safari media Query for ipad

@media only screen and (min-width: 768px) and (max-width:1199px) {}

I want to put Media query only for safari browser for given Size of device.

@media screen and (-webkit-min-device-pixel-ratio:0) and (min-width: 768px) and (max-width:1199px) { ::i-block-chrome,.allsearch-in select{display:none;} }

still not Working...

Upvotes: 2

Views: 12644

Answers (2)

Momin
Momin

Reputation: 3320

CSS Media Queries for iPads & iPhones

iPad in portrait & landscape

@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px)  { /* STYLES GO HERE */}

iPad in landscape

@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : landscape) { /* STYLES GO HERE */}

iPad in portrait

@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : portrait) { /* STYLES GO HERE */ }

Browser Specific Hacks

/* saf3+, chrome1+ */
@media screen and (-webkit-min-device-pixel-ratio:0) {
#diez  { color: red  }
}

 /* iPhone / mobile webkit */
 @media screen and (max-device-width: 480px) {
  #veintiseis { color: red  }
 }

ThankYou

Upvotes: 3

Mohamed Abo Elmagd
Mohamed Abo Elmagd

Reputation: 1137

Add Class for safari browser to determine browser name by javascript

var ua = navigator.userAgent.toLowerCase(); 
if (ua.indexOf('safari') != -1) { 
  if (ua.indexOf('chrome') == -1) {
    alert("2"); // Safari
    //add class to body tag
  }
}

then use this class in css.

Upvotes: 0

Related Questions