gpt4 book ai didi

html - 如何将水平线放在两个兄弟

标签下

转载 作者:太空宇宙 更新时间:2023-11-03 22:12:10 24 4
gpt4 key购买 nike

我有以下 html 供我查看。

p {
width: 50%;
float: left;
}
<div>
<p>The first paragraph.</p>
<p>The second paragraph.</p>
<p>The third paragraph.</p>
<p><b>Note:</b> Internet Explorer 8 and earlier versions do not support the :nth-child() selector.</p>
</div>

我不允许对 html 进行任何更改。我想要每两个

标签后一行,如下图所示。(p 标签的数量不限于四个。它们可以增加。)

enter image description here

有人可以告诉我怎么做吗?甚至有可能吗?

最佳答案

div {
display: flex;
flex-wrap: wrap;
}
div p {
max-width: 50%;
flex-grow: 1;
flex-basis: 0;
border-bottom: 1px solid black;
}

关于html - 如何将水平线放在两个兄弟 <p> 标签下,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58838875/

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