html - 为什么我的 CSS 样式没有正确应用?
问题描述
当宽度> 959px 我要显示的是一列。500px < 宽度 <959px,它将是 2 列。<500px 宽度将是一列。
宽度 >959 像素
500px < 宽度 <959px
宽度 <500 像素
.img-wi{
width:100%;
display: inline-block;
border:2px solid #13aff2;
margin-top:10px;
}
@media only screen and (max-width:959px) {
.left-w{
float:left;
width:49%
}
.right-w{
float:right;
width:49%
}}
.text-wi{
border-top:2px dashed #13aff2;
padding: 5px 0 0 20px;
}
@media only screen and (max-width:500px) {
.left-w{
float:none;
width:100%
}
.right-w{
float:none;
width:100%
}}
<div class="img-wi left-w">
<img class="aligncenter" src="/new-1.png" alt="" width="288" height="64">
<div class="text-wi">
<strong>AAAA</strong><br>
– A<br>– B<br>– C<br>
</div>
</div>
<div class="img-wi right-w">
<img class="aligncenter" src="/new-2.png" alt="" width="288" height="64">
<div class="text-wi"><strong>AAAA</strong><br>
– A<br>– B<br>– C<br>
</div></div>
我做错了什么?
任何帮助表示赞赏
解决方案
推荐阅读
- node.js - 求点 A 到 B 的角度偏移
- java - 如何在 github 操作工作流中运行我的单元测试?
- apache-kafka - Kafka 更适合什么样的数据量处理?我在这里找数字
- sqlite - @user 的 discord.js 排名命令
- python - python pandas deepdiff 两个yaml文件并打印不匹配值
- html - HTML 锚链接(页内书签)跳转到错误的位置
- elasticsearch - 当我重新启动服务器时,Elasticsearch 不会自动启动
- bash - 需要帮助将源目录添加到 bash 脚本
- c++ - 既然我们有内联变量,还有用 extern const 吗?
- c++ - 我在 OpenGL 中显示图像时遇到问题