html - 媒体查询 CSS 问题

标签 html css media-queries

我的 css 中的媒体查询有问题,我想在屏幕尺寸为 900 像素时应用一种样式,但该样式在屏幕尺寸为 810 像素之前一直有效。

这是我的视口(viewport):

<meta name="viewport" content="width=device-width,initial-scale=1.0, user-scalable=no">

这是我的CSS:

@media all and (max-width: 900px){
    .form{display:none;}
}

我的html只有这个

<div class="form"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p></div>

我找不到关于这个问题的解决方案。 感谢您的帮助:)。

最佳答案

我遇到了这个问题,只是我不小心缩小了浏览器屏幕。

关于html - 媒体查询 CSS 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26041655/

相关文章:

javascript - 媒体查询打印不适用于 javascript 命令

html - 右对齐 img 元素内的文本 div

html - 定位:after pseudoelement

php - 提交联系我们表格时,我想留在这个联系表格中

css - LESS CSS - ID 和背景段落

html - 清除媒体查询的层次结构

jquery - 根据媒体查询反转 jQuery 下拉列表的行为

html - Bootstrap4 中的多个容器彼此相邻

javascript - CSS3 : Is it possible to fire a transition on an element when the page is scrolled down the first viewport?

css - 如何破解 :last-child in IE 7 and 8?