html - 我无法对高度一 div 进行媒体查询
问题描述
我的项目中有几个 div,当我将具有新 div 高度的媒体查询添加到 css 样式表时,当我在 firefox 响应模式下打开它时,它将不起作用。我已经很沮丧了,因为不同的查询有效,但高度不合作。
html:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
CSS:
.div2-area{
background-color: grey;
width: 100%;
height: 200vh;
font-family: 'Palatino Linotype';
text-align: left;
color: white;
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
background-image: url(../images/33.jpg);
}
@media only screen and (max-width: 300px) {
.div2-area {
height: 450vh;
}
}
解决方案
推荐阅读
- c++ - C++/MySQL 连接器 - CDK 错误:字符串转换失败
- orocrm - 来自 bitnami 的 OroCRM 4.1.6 VM 映像 - 在代理后面时,每个页面上 /api/rest/latest/navigationitems/pinbar 上的错误 404 加载
- python - 退出后如何访问在“while True:try/break”循环中生成的局部变量?
- c# - Caliburn.Micro 导航导致 StackOverflowException
- javascript - 反应useState不更新对象数组
- java - 如何获取给定字符串的文件大小?
- flutter - 发布失败(65')退出代码65
- python-3.x - Python 请求在下载二进制文件时工作非常缓慢
- c++ - STL 列表函数,从列表中删除第 N 个元素并将其替换为同一列表 C++ 中的第 M 个元素。必须使用重新链接
- r - 包 RODBC 不适用于 R 版本 3.5.1。如何创建 ODBC DSN?