Javascript css会移动更多加载的帖子

Javascript css会移动更多加载的帖子,javascript,css,margin,Javascript,Css,Margin,关于我的问题的图片: 当我加载更多的帖子时,新帖子的内容风格又变了,我试着在不加载更多的情况下加载这些帖子,效果很好。正如你在图片上看到的,加载更多的帖子会像这样,如果我加载更多的帖子,它会变得疯狂 <div id="content"> <div class="inner"> $last_post_id=$_GET['last_post_id']; $action=$_GET['action']; if($action <> "get") { ?>

关于我的问题的图片:

当我加载更多的帖子时,新帖子的内容风格又变了,我试着在不加载更多的情况下加载这些帖子,效果很好。正如你在图片上看到的,加载更多的帖子会像这样,如果我加载更多的帖子,它会变得疯狂

<div id="content">
<div class="inner">
$last_post_id=$_GET['last_post_id'];
$action=$_GET['action'];

if($action <> "get")
{

?>
                <!-- Post -->
                    <script type="text/javascript">
var bSuppressScroll = false;

$(document).ready(function(){

    function last_msg_funtion() 
    { 

       var ID=$("div.postsize:last").attr("id");

        $.post("main.php?leht=latest&action=get&last_post_id="+ID,

        function(data){
            if (data != "") {
            $("div.postsize:last").after(data);
            window.bSuppressScroll = false;         
            }
            $('div#last_post_loader').empty();

        });
    };  

    $(window).scroll(function(){
        if ( ( $(window).scrollTop() == $(document).height() - $(window).height() ) && window.bSuppressScroll == false ){
            last_msg_funtion();
        window.bSuppressScroll = true;
        }
    }); 

});



</script>

<?php
include('include/latest1.php');
echo $list;

}
else
{
include('include/latest.php');  
echo $list2;
}
?>
</div>
</div>

不要使用
.after
div.postsize:last
,尝试使用
。append
div.postsize
替换$(“div.postsize:last”)。在(数据)之后;在(数据)之后加上$(“#content>.inner”);尝试过这些,但他们仍然有自己的内容风格
#content {
            padding: 3em 5em 8em 5em;
            margin-left: 21em;
        }