页面内容在页面滚动时向左浮动并且居中对齐

时间:2019-07-18 15:24:48

标签: html css wordpress

页面内容最初是向左浮动的,向下滚动时将显示在页面中央。

请参阅https://buckbaaz.com/category/photography/

我找不到CSS问题

有帮助吗?

代码     
          

        <div class="col-md-12 text-center pad20">
             <h1>Category : <?php the_category(', '); ?></h1>
        </div>
    <?php    
    if (have_posts()) : while (have_posts()) : the_post();
    ?>  


        <div class="col-xs-12 col-sm-12 col-md-4 text-center">
             <h2><a href="<?php the_permalink(); ?>"><?php echo the_title(); ?></a></h2>
             <?php
                if (is_category( $category = 'Photography' ) ) {
                    if(has_post_thumbnail()){
                echo '<div class="postthumb">';
                the_post_thumbnail('thumbnail');
                echo '</div>';

                  }
                }
             ?>
        </div>
    <?php   
    endwhile;

    // Archive doesn't exist:
    else :

        esc_html__( 'Nothing found, sorry.','north' );

    endif;    

    vntd_pagination();       



    ?>
    </div>
</div>

1 个答案:

答案 0 :(得分:2)

使页面内容DIV全宽:

#page-content {
    overflow: hidden;
    position: relative;
    width: 100%;
}
相关问题