【发布时间】:2019-10-01 12:50:50
【问题描述】:
我在 html 中有以下内容:
.horizontal-div {
display: flex;
flex-direction: row;
}
.style-1 {
width: 140px;
height: 19px;
font-size: 16px;
color: #272d37;
margin-top: 19px;
margin-left: 8px;
}
.style-2 {
width: 16px;
height: 16px;
float: right;
margin-left: 295px;
cursor: pointer;
}
<div class="horizontal-div">
<div class="style-1">Dummy QC</div>
<div class="style-2">Some image</div>
</div>
我观察到“虚拟 QC”进入下一行,如下所示:
有什么办法可以避免它进入下一行?
【问题讨论】:
-
你真的需要为这些容器设置宽度吗?