Wordpress:页脚下方的空白区域

问题描述 投票:0回答:1

我的WP网站上有4个网页中有2个出现问题。

我的页脚下面有一个空格。我试过了位置:固定;和底部:0; ..但它不起作用。

我现在有点卡住了。

PHP代码

<?php
/* Template Name: Contact_page */
get_header(); /* HÄMTA HEADER */
?>

<?php
    $args = array( 'post_type' => 'employe', 'posts_per_page' => 10 );
    $loop = new WP_Query( $args );
        while ( $loop->have_posts() ) : $loop->the_post();
?>      

<section class="contact_section"> 

        <article>
        <?php the_content(); ?> 
        <?php the_post_thumbnail();?>   
        </article>
 </section> 
 <?php
 endwhile;
 ?>

<?php
get_footer(); /* HÄMTA FOOTER */
?>

这是联系页面的css代码

.contact_section{
margin: auto;
max-width: 60%;
margin-top: 40px;   
}


.contact_section article {
margin-top: 20px; 
width: 60%;
margin:auto;
}

.contact_section p {
float: left;
font-size: 1.8em;
}

.contact_section img{
margin-left: 20px;
}

页脚的CSS

footer {
clear: both;
text-align: center;
bottom: 0;

background-color: #444444;
height: 200px;
padding-top: 30px;
padding-bottom: 10px;
}
php css wordpress
1个回答
0
投票

您需要将页脚放置到absolute并在底部给body标签填充200px,如下所示:

body {
  /* 200px for the footer and 30px for the padding body */
  padding-bottom: 230px;
}

footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
}
© www.soinside.com 2019 - 2024. All rights reserved.