0
我得到错误,因为我的div,不会浮在所有我的div不会左右浮动?
这里是我的CSS
#content {
width: 1070px;
}
.date{
float:left;
width:80px;
margin: 50px 8px 0px -60px;
padding: 0px 0px 0px 0px;
}
.month {
color:#fff;
font-size:15px;
font-family:eurofurence;
text-transform:uppercase;
}
.year {
color:#fff;
padding:0 0 7px 0;
font-size:30px;
font-family:eurofurence;
text-transform:uppercase;
}
.commentbubble{
background: url('http://bleedartmedia.com/mock/wp-content/themes/KellyRowland/images/commentb.png') no-repeat;
width:40px;
height:49px;
padding:4px 0 0 14px;
}
.entry {
float:right;
margin: 0px 8px 0px 0px;
padding: 20px 0px 0px 0px;
border-bottom: 0px solid #cccccc;
font-family:eurofurence;
font-size:17px;
width:610px;
background:#fff;
}
,这里是我的设置
<div id="content">
<?php while (have_posts()) : the_post() ?>
<div class="date">
<div class='month'><?php the_date('M');?></div>
<div class='year'><?php the_time('d');?></div>
<div class="commentbubble">
<?php comments_popup_link(__('0', 'wpbx'), __('1', 'wpbx'), __('%', 'wpbx')) ?>
</div>
Comments
</div>
<div class="entry">
<div class="entry-top">
<h2 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'wpbx'), the_title_attribute('echo=0')) ?>" rel="bookmark"><?php the_title() ?></a></h2>
</div>
<div class="entry-content clearfix">
<div class="entry-content">
<div id="text"><?php the_content() ?></div>
</div>
</div>
<div class="entry-meta">
<span class="entry-meta-sep">|</span>
<span class="entry-more"><a href="<?php the_permalink() ?>" title="<?php printf(__('Continue reading %s'), wp_specialchars(get_the_title(), 1)) ?>"><?php _e('Read More »', 'wpbx') ?></a></span>
</div>
</div><!-- .post -->
<?php endwhile; ?>
<div class="navigation clearfix">
<div class="nav-previous"><?php next_posts_link(__('Previous <span class="meta-nav">Articles</span>', 'wpbx')) ?></div>
<div class="nav-next"><?php previous_posts_link(__('Next <span class="meta-nav">Articles</span>', 'wpbx')) ?></div>
</div>
</div><!-- #content -->
问题是我想要的“日期”div浮动到“入口”div的左侧,但所有的“日期”div做的是坐在顶部的入口div为什么?
@TheBlackBenzKid谢谢!下次我会正确格式化代码:) – Dipak
没问题。它更直接针对原始用户。 – TheBlackBenzKid
最近我开始对'left'和'right'使用不同的css,并将它们作为第二个类添加到我的元素中。使事情更容易遵循。 +1! –