UI_*_*Dev 2 html css android media-queries
我对媒体查询进行了一些研究,但对获得平板电脑宽度感到非常困惑。
我发现的一些例子:
# Mobile
only screen and (min-width: 480px)
# Tablet
only screen and (min-width: 768px)
# Desktop
only screen and (min-width: 992px)
# Huge
only screen and (min-width: 1280px)
Run Code Online (Sandbox Code Playgroud)
但是,如今平板电脑的尺寸各不相同。有些平板电脑看起来很大,那么如何找到平板电脑的最大宽度?
到目前为止,我使用如下..
# Tablet
only screen and (min-width: 768px) and (max-width: 979px)
Run Code Online (Sandbox Code Playgroud)
我需要知道平板电脑的最大宽度来修复我的响应式设计。我可以为平板电脑使用 786 像素的最小宽度吗?我要所有品牌平板设备(三星、ipad、Google Nexus 系列)
我目前正在使用的。
/* 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 */
}
/* Tablet (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px) {
/* Styles */
}
/* Tablet (landscape) ----------- */
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px)
and (orientation : landscape) {
/* Styles */
}
/* Tablet (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),
only screen and (min-device-pixel-ratio : 1.5) {
/* Styles */
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9144 次 |
| 最近记录: |