gpt4 book ai didi

css - Clearfix 停止自动换行

转载 作者:太空宇宙 更新时间:2023-11-04 04:07:02 26 4
gpt4 key购买 nike

我必须对我的列表项应用一个 clearfix 以便边框环绕我的 float ,但是一旦我添加了 clearfix,它导致我应用到列表的 wordwrap 停止工作,现在长 URL 扩展了div 到其他 div。

如果有人能帮助解决这个问题,我们将不胜感激。问题可以在这里查看:http://www.noellesnotes.com (页脚的推文部分)。

相关代码如下:

HTML

<div id="tweets">
<ul>
<li class="clearfix">
<p class="tweet">The tweet.</p>
<p class="timePosted">TIME</p>
<p class="interact">INTERACT LINKS</p>
</li>
</ul>
</div>

CSS

.tweet, .tweet a, .tweet span, .interact a{
margin-bottom: 10px;
font-size: 12px;
font-family: 'Open Sans', sans-serif, Georgia, sans-serif;
word-wrap:break-word;
}

.timePosted{
width:40%;
font-size: 12px;
float: left;
font-weight: bold;
text-align: left;
}

.interact{
width:60%;
font-size: 12px;
float: left;
text-align: right;
overflow: hidden;
}

.interact a{
margin-right: 3px;
text-decoration: underline;
font-family: 'Arvo', Georgia;
}

#tweets ul{
margin-left: 0;
padding-left: 0;
list-style: none;
}

#tweets ul li{
border: 3px solid rgba(255,255,255,0.4);
margin: 3px 0;
padding: 3px;
}

.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}

.clearfix { /* for IE/Mac */
display: inline-block;
}

最佳答案

添加:

#tweets ul li { width: 100%; }

为我解决了这个问题:)

关于css - Clearfix 停止自动换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21220835/

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