skh*_*ams 2 css asp.net screen-resolution media-queries twitter-bootstrap
我已经完成了一个网站,它现在在浏览器中运行良好.我被要求使其兼容Android,iPhone,iPad,平板电脑和网络等.我正在使用bootstrap asp.net.
现在我正在努力,找不到任何答案.我正在使用这些内联媒体查询
@media screen and (min-width:0px) and (max-width:320px){/*Any css will be defined here*/}
@media screen and (min-width:321px) and (max-width:480px){/*Any css will be defined here*/}
@media screen and (min-width:481px) and (max-width:540px){/*Any css will be defined here*/}
@media screen and (min-width:541px) and (max-width:775px){/*Any css will be defined here*/}
@media screen and (min-width:768px) and (max-width:783px){/*Any css will be defined here*/}
@media screen and (min-width:776px) and (max-width:1536px){/*Any css will be defined here*/}
@media screen and (min-width:1537px){/*Any css will be defined here*/}
Run Code Online (Sandbox Code Playgroud)
但在某些iPad中,CSS并未应用.现在我的问题是,@ media的标准分辨率和方向是什么,它将覆盖所有(Android,iPhone,平板电脑和Web等)CSS?
小智 5
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
/* Styles */
}
/* Smartphones (portrait) ----------- */
@media only screen
and (max-width : 320px) {
/* Styles */
}
/* iPads (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px) {
/* Styles */
}
/* iPads (landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape) {
/* Styles */
}
/* iPads (portrait) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : portrait) {
/* Styles */
}
/* Desktops and laptops ----------- */
@media only screen
and (min-width : 1224px) {
/* Styles */
}
/* Large screens ----------- */
@media only screen
and (min-width : 1824px) {
/* Styles */
}
/* iPhone 4 ----------- */
@media only screen
and (-webkit-min-device-pixel-ratio : 1.5),
and (min-device-pixel-ratio : 1.5) {
/* Styles */
}
Run Code Online (Sandbox Code Playgroud)
这就是我使用的东西,几乎适用于所有东西.
| 归档时间: |
|
| 查看次数: |
13376 次 |
| 最近记录: |