【发布时间】:2015-05-05 21:53:35
【问题描述】:
当我为我的网站编写媒体查询时,我想到了这个: 浏览器的地址栏会影响 CSS 媒体查询吗?
当我编码时:
/* Portrait */
@media screen
and (device-width: 320px)
and (device-height: 640px)
and (orientation: portrait) {
}
我在考虑浏览器地址栏的高度吗? 地址栏会减去屏幕视口的像素吗?
我必须考虑这个媒体查询吗?
/* Portrait */
@media screen
and (device-width: 320px - <AddressBarHeight>)
and (device-height: 640px - <AddressBarHeight>)
and (orientation: portrait) {
}
【问题讨论】:
-
您使用的是设备高度/宽度,因此您正在寻找设备屏幕的物理尺寸。
-
不,只有视口。您的页面对浏览器的 chrome(呈现页面之外的 UI 元素)一无所知。
标签: html css media-queries responsiveness