我在两个 div 元素之间出现了一个空白
col3-2
和 the_content
我一直无法解析。
Visit site here 您可以看到图像和绿色元素之间的白色间隙。
HTML - PHP:
<div id="imageslider" class="clearfix">
<?php echo do_shortcode('[advps-slideshow optset="1"]'); ?>
</div>
<div class="col3-2">
<div id="content" class="clearfix">
<?php
$args = array( 'pagename' => 'home' );
$the_query = new WP_Query( $args );
while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="the_content">
<?php the_content(); ?>
<?php edit_post_link(__('Click to edit this content','themify'), '[', ']'); ?>
</div>
<?php endwhile; wp_reset_query();?>
</div>
</div>
CSS:
.col3-2
{
float: left;
margin-left: 0%;
}
.col3-2 {
width: 100%;
font-family: 'Titillium Web', sans-serif;
}
.col3-2 h1 {
margin-right: 20px;
font-size:300%;
}
.the_content{
display: none;
}
#content {
float: left;
padding: 0 0 0%;
width: 100%;
}
最佳答案
问题在于一个无关的<p>
标 checkout 现在 div.the_content
标签:
<div class="col3-2">
<div id="content" class="clearfix">
<div class="the_content">
<p></p>
...
看起来您是从其他地方提取的,因此编辑您发布的代码可能不会有太大帮助。只需删除 <p></p>
来自内容的来源。
关于html - 删除 Div 元素之间的间隙,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34387979/