gpt4 book ai didi

html - 文本流动到下一行

转载 作者:行者123 更新时间:2023-11-28 15:05:29 25 4
gpt4 key购买 nike

我在 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>

我观察到“Dummy QC”进入下一行,如下所示:

enter image description here

避免它进入下一行的解决方案是什么?

最佳答案

您可以使用 CSS white-space 属性

.horizontal-div {
display: flex;
flex-direction: row;
white-space: nowrap;
}

关于html - 文本流动到下一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58185147/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com