Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html CSS边框不适合项右侧_Html_Css_Border - Fatal编程技术网

Html CSS边框不适合项右侧

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>

我在上有一个页面,我试图使评论周围的边框不高于图像底部,因此我对其中一条评论的html有以下内容:

<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&amp;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; }