gpt4 book ai didi

html - 文本使图像下降,从而弄乱了 UI

转载 作者:行者123 更新时间:2023-11-28 07:44:54 25 4
gpt4 key购买 nike

我写了一个这样的用户界面:
img
这是代码:
HTMLcode:

<div class = "category2 ctg">
<span class = "ctgryName2">Junos OS Fundamentals</span>
<span class = "ctgryIcon2 pull-right"></span>
<span class = "Icon2 pull-right"></span>
</div>

CSS代码:

.category2{
width: 49%;
line-height : 35px;
border-bottom: 1px solid grey;
}
.ctg{
float: left;
}
.ctgryName2{
color: grey;
font-size: 15px;
font-weight: 500;
font-family: "robotRegular";
overflow: auto;
}
.ctgryIcon2{
background-image: url("../JunosImages/mob/challenger-inactive_icon.png");
background-repeat: no-repeat;
background-size: 100% 100%;
display: block;
height: 28px;
margin-top: 0.7%;
width: 30px;
}
.Icon2{
background-image: url("../JunosImages/mob/practice-inactive_icon.png");
background-repeat: no-repeat;
background-size: 100% 100%;
display: block;
height: 28px;
margin-top: 0.7%;
width: 30px;
}

如果我像这样添加额外的文本:

<div class = "category2 ctg">
<span class = "ctgryName2">Junos OS Fundamentals abracardabra blah blah lorem lpsum</span>
<span class = "ctgryIcon2 pull-right"></span>
<span class = "Icon2 pull-right"></span>
</div>

然后UI变成这样:
img1
我希望以整个文本和图像位于同一行的方式调整文本。我该怎么做?

最佳答案

我认为这应该可行:

<span class = "ctgryName2" style="white-space:nowrap;">Junos OS Fundamentals abracardabra blah blah lorem lpsum</span>

有关 white-space 的更多信息,请查看 link出。

关于html - 文本使图像下降,从而弄乱了 UI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30749247/

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