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;