为了让边框环绕我的浮点数,我必须对列表项应用一个清除程序,但是一旦我添加了清除程序,它就会导致我应用到列表中的一个字包装停止工作,现在长URL将div扩展到其他div。
如果有人能在这个问题上有所帮助,我们将不胜感激。这个问题可以在这里查看:http://www.noellesnotes.com (页脚的Tweets部分)。
以下是相关代码:
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;
}发布于 2014-01-19 18:35:40
增加:
#tweets ul li { width: 100%; }为我解决了这个问题:)
https://stackoverflow.com/questions/21220835
复制相似问题