gpt4 book ai didi

javascript - 将单个单词对齐成行

转载 作者:行者123 更新时间:2023-11-28 02:43:07 24 4
gpt4 key购买 nike

我想用 CSS 和可能的 jQuery 证明将一个词分成三行。

它采用流畅的布局,单词应填充父 div 的 100%。

这是我想要实现的:

/image/AFlqh.png

谢谢!

最佳答案

你可以这样做:

body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: #111;
}

.flex {
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
width: 836px;
max-width: 100%;
height: 478px;
margin: 0 auto;
background: #fff;
}

.flex > span {
width: 33.33%;
font-size: 6em;
font-weight: bold;
font-family: sans-serif;
text-align: center;
}

.flex > span:nth-child(8) {
visibility: hidden;
}
<div class="flex">
<span>S</span>
<span>T</span>
<span>R</span>
<span>E</span>
<span>N</span>
<span>G</span>
<span>T</span>
<span>hidden</span>
<span>H</span>
</div>

关于javascript - 将单个单词对齐成行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47065281/

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