gpt4 book ai didi

html - 我怎样才能完美地对齐它?

转载 作者:太空宇宙 更新时间:2023-11-03 21:54:57 25 4
gpt4 key购买 nike

演示:http://jsfiddle.net/CtCuk/10/

如果您查看演示,“这是新闻”部分已折叠。

但是我希望这个部分在中间垂直,并且一直向右。
然后,如果窗口大小变窄,它应该开始折叠字符。

这可能吗?

HTML

<div class="top_page">
<div class='container-general'>
<div class="annouce-row">
<div class='title'>
New
</div>
<div class='announcement'>
Here is News
</div>
</div>
</div>
</div>

CSS

.top_page{
width: auto;
max-width: 900px;
margin: 50px auto 20px;
}

.annouce-row {
width: 800px;
}

.annouce-row div {
width: 100px;
display: inline-block;
}

.title {
padding: 20px 10px;
background-color: rgb(123, 0, 218);
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
margin: 1px;
color: rgb(255, 255, 255);
font-size: 22px;
width: 70px;
}

.announcement {
font-size: 24px;
font-weight: 200;
color: rgb(0, 174, 218);
margin-left: 0px;
width: 600px;
}

最佳答案

去掉这 100px 的宽度,文本将保持在同一行

.annouce-row div {
width: 100px; /*this line*/
display: inline-block;
}

关于html - 我怎样才能完美地对齐它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14566656/

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