iPad specific code within CSS

天大地大妈咪最大 提交于 2019-12-07 12:36:23

The easiest solution would be to use media queries to determine when the viewer is using a display that has the screen size of the ipad, or any other device with a similar size.

@media all and (max-device-width: 768px) {
  // insert css specific to ipad portrait
}

@media all and (max-device-width: 480px) {
  // insert css specific to iphone landscape
}

@media all and (max-device-width: 320px) {
  // insert css specific to iphone portrait
}

In addition to above, you can include something like http://rafael.adm.br/css_browser_selector/

which allows you to apply specific rules based on what mobile/OS/etc is being sniffed out and just listing the correct class

you can apply specific rules for whatever you need for e.g.

.ipad #div1 {
/* rules here */
}

.iphone #div2 {
/* rules here*/
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!