gpt4 book ai didi

html - float 左侧容器卡在中间

转载 作者:行者123 更新时间:2023-11-28 18:47:40 24 4
gpt4 key购买 nike

我有以下代码:http://jsfiddle.net/69MqZ/1/

如您所见,灰色文本行一直到灰色元数据:enter image description here

尽管左边的名字很长,但我希望它是这样的:enter image description here

显然它必须使用 position: relative 或某种技术来使 border-bottom 相应地移动。这是 WordPress 生成的评论输出。

我在这里面临同样的问题(所有容器都有 float: left;): enter image description here

最佳答案

您需要在评论作者姓名和元数据 周围包裹一个父元素 - .comment-author 和 .comment-meta - 然后 float 该父元素。例如:

 <div class="comment_author_wrap">
<div class="comment-author vcard">
<cite class="fn">John Smith</cite> <span class="says">says:</span>
</div>

<div class="comment-meta commentmetadata">
<a href="#comment-3">May 23, 2010 at 5:04 pm</a>&nbsp;&nbsp;<a title="Edit comment" href="3" class="comment-edit-link">(Edit)</a>
</div>
</div>

然后

.comment_author_wrap {
float: left;
}

这将使评论文本如您所愿一直出现到该区域的顶部。

关于html - float 左侧容器卡在中间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10143306/

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