Mag*_*got 1 html css wordpress css3 column-count
首先,我在这里发现了问题,但答案不太适合我的情况,这就是为什么我问一个问题,这看似相似但不是.如果这在某种程度上有意义:-D
我正在创建一个儿童主义的"响应性"-Wordpresstheme来自cyberchimps.
为此,我需要文本在3列中进行整形,但也可以在网站的后端进行编辑.我用CCS管理过:
.col-940{
clear: none;
-webkit-column-count: 3; /* Chrome, Safari, Opera */
-webkit-column-gap: 40px;
-moz-column-count: 3; /* Firefox */
-moz-column-gap: 40px;
column-count: 3;
column-gap: 40px;
}
p {
margin: 5px 0px 0px 0px;
}
Run Code Online (Sandbox Code Playgroud)
现在产生问题,第一列比下面的列低5px.我无法弄清楚为什么.
如上所述,其他线程中的答案将不起作用,因为我还有仅使用2列的子站点,这就是为什么我不能使用定义的宽度.在文本所在的div之上/之前总是只有另一个div.
(PHP)文本所在的容器:
<?php if( have_posts() ) : ?>
<?php while( have_posts() ) : the_post(); ?>
<?php responsive_entry_before(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php responsive_entry_top(); ?>
<div class="post-entry">
<?php the_content( __( 'Read more ›', 'responsive' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="pagination">' . __( 'Pages:', 'responsive' ), 'after' => '</div>' ) ); ?>
</div>
<!-- end of .post-entry -->
<?php responsive_entry_bottom(); ?>
</div><!-- end of #post-<?php the_ID(); ?> -->
<?php
endwhile;
get_template_part( 'loop-nav' );
else :
get_template_part( 'loop-no-posts' );
endif;
?>
Run Code Online (Sandbox Code Playgroud)
PHP生成的(HTML)容器:
<div id="post-25" class="post-25 page type-page status-publish hentry">
<!--
<h1 class="entry-title post-title">Kontakt</h1>…
-->
<div class="post-entry">
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing …
</p>
</div>
<!-- end of .post-entry -->
</div>
<!--end of #post-25 -->
Run Code Online (Sandbox Code Playgroud)
屏幕:
小智 5
您已经应用了5px margin-top,并且在列顶部发生的唯一位置是在第一个的开头.你需要删除这个margin-top,也许是
.post-entry > p:first-child {
margin: 0;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7019 次 |
| 最近记录: |