Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

ipad specific media query

/*working only in ipad portrait device*/
@media only screen and (width: 768px) and (height: 1024px) and (orientation:portrait) {
  body{
    background: red !important;
  }  
}
/*working only in ipad landscape device*/
@media all and (width: 1024px) and (height: 768px) and (orientation:landscape){
  body{
    background: green !important;
  }   
}

In the media query of specific devices, please use '!important' keyword to override the default CSS. Otherwise that does not change your webpage view on that particular devices.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #ipad #specific #media #query
ADD COMMENT
Topic
Name
9+8 =