html - 为什么这个响应式 CSS 不能改变我的布局?
问题描述
<!DOCTYPE HTML>
<html style="height: 100%;">
<head>
<link rel="stylesheet" href="style.css"></head>
</head>
<body style="height: 100%;">
<div class="flexParent">
<div id="sidebar" class="sidebar debug"></div>
<div id="summary" class="mainContent debug"></div>
</div>
</body>
</html>
@media (max-width:250px){
.flexParent{display: flex;flex-direction:column;}
}
.debug{border-style: solid;}
.flexParent{display:flex;height:100%;width:100%;margin:0;flex-direction: row;}
.sidebar{flex: 0 1 200px;height: 100%;text-align: center;margin-right: 2px;}
.mainContent{flex: 1;}
当我尝试将浏览器设置为 240 像素时,它不起作用。我认为这应该将行更改为列。
解决方案
推荐阅读
- python - Github REST API 不适用于自定义域
- react-admin - 使用 OpenID Connect 反应管理员
- google-maps - 如何更改切换全屏视图按钮的颜色
- jmeter - 如何将一个请求中生成的访问令牌传递给jmeter中的所有请求?
- python - 加速 Metropolis——Python 中的 Hastings
- ruby-on-rails - array_enum 将字符串隐式转换为整数异常
- azure - 如何使用“将 Word 文档转换为 PDF”将文件转换为 Azure Logic Apps?
- elasticsearch - Kibana 未显示来自外部 Elasticsearch 节点的监控数据
- php - 显示从 1 .php 到另一个变量的问题
- intellij-idea - 如何更改 IntelliJ IDEA 中的工具栏和图标比例?