Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/80.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/39.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 通过PHP添加内容时移动div_Html_Css - Fatal编程技术网

Html 通过PHP添加内容时移动div

Html 通过PHP添加内容时移动div,html,css,Html,Css,在我的网站上有多篇博客文章,用户可以在这些博客文章的底部添加评论。当用户添加注释时,注释下方的内容不会向下移动以容纳它,因此注释将放置在其他内容上。我怎样才能解决这个问题 代码的示例思想: <div class=blogPost> <article> <p>Blog Entry</p> <div id="commentsHolder"> </div> </article> &l

在我的网站上有多篇博客文章,用户可以在这些博客文章的底部添加评论。当用户添加注释时,注释下方的内容不会向下移动以容纳它,因此注释将放置在其他内容上。我怎样才能解决这个问题

代码的示例思想:

<div class=blogPost>
  <article>
    <p>Blog Entry</p>
    <div id="commentsHolder">
    </div>
  </article>
  <div class="commentForm">
    <?php showing form if user is logged in ?>
  </div>
</div>
<div class=blogPost>
  <article>
    <p>Blog Entry</p>
    <div id="commentsHolder">
    </div>
  </article>
  <div class="commentForm">
    <?php showing form if user is logged in ?>
  </div>
</div>
...etc...
当注释添加到
commentsHolder
时,我需要页面的其余部分向下移动以容纳新注释。如果您需要我提供的任何特定代码,请告诉我。

尝试更换

height: 730px;

在你的CSS规则中。当内容添加到
.blogPost
时,它将对其进行缩放。它假定
#commentsHolder
也处于相对位置


您也不想添加具有重复
id
属性(commentsHolder)的元素。

谢谢您的回复,非常简单的修复程序,效果非常好!另外,
id
属性在我的实际代码中没有重复,这只是一个复制粘贴错误。
height: 730px;
min-height: 730px;