Html CSS边框不适合项右侧
我在上有一个页面,我试图使评论周围的边框不高于图像底部,因此我对其中一条评论的html有以下内容:Html CSS边框不适合项右侧,html,css,border,Html,Css,Border,我在上有一个页面,我试图使评论周围的边框不高于图像底部,因此我对其中一条评论的html有以下内容: <li class="comment-item"> <a name="comment-94"></a> <div class="comment-buttons"> <a href="javascript:report(94);" class="report">Report</a>
<li class="comment-item">
<a name="comment-94"></a>
<div class="comment-buttons">
<a href="javascript:report(94);" class="report">Report</a>
<a href="javascript:add_vote(94);" class="vote" id="vote-94">+1</a>
<a href="?id=49&replytocom=94#respond" class="reply">Reply</a>
</div>
<img src="/images/avatars/default.png" height="85" width="100">
<p class="user">nat45928</p>
<p class="date">August 3, 2011, 5:04 am</p>
<p class="comment-body">test</p>
</li>
为什么会发生这种情况?我如何修复它?在每个
下面添加一个div。注释正文
如下:
<li class="comment-item">
<a name="comment-93"></a>
<div class="comment-buttons">
<a href="javascript:report(93);" class="report">Report</a>
<a href="javascript:add_vote(93);" class="vote" id="vote-93">+0</a>
<a href="?id=49&replytocom=93#respond" class="reply">Reply</a>
</div>
<img src="/images/avatars/default.png" width="100" height="85" />
<p class="user">nat45928</p>
<p class="date">August 3, 2011, 5:04 am</p>
<p class="comment-body">test</p>
<div style="clear:both;"></div>
</li>
nat45928
2011年8月3日上午5:04
测试
添加内容项(您的LI)
在您结束之前
加:
这不会将注释正文推到图像下吗?Arf…在IE中产生空白的非语义标记?不要认为这很好。@splitter-line-height和font-size为0将修复间距,但不是额外的div:)这是包装浮动元素的一种非常常见的技术。应在浮动元素的容器上应用,以便它们包装浮动元素。这是必要的,因为一旦浮动元素,它就不再是正常流的一部分,容器不知道元素的结束位置,只会忽略它,只包装其余的内容。
<li class="comment-item">
<a name="comment-93"></a>
<div class="comment-buttons">
<a href="javascript:report(93);" class="report">Report</a>
<a href="javascript:add_vote(93);" class="vote" id="vote-93">+0</a>
<a href="?id=49&replytocom=93#respond" class="reply">Reply</a>
</div>
<img src="/images/avatars/default.png" width="100" height="85" />
<p class="user">nat45928</p>
<p class="date">August 3, 2011, 5:04 am</p>
<p class="comment-body">test</p>
<div style="clear:both;"></div>
</li>
min-height:95px;
<div style="clear:both"></div>
.comment-item:before, .comment-item:after { content: ""; display: table; }
.comment-item:after { clear: both; }
.comment-item { zoom: 1; }