我想堅持3個div,但我不能。我不知道什麼是錯的。我如何將這些div粘在一起?
這裏是screenshot。
HTML
<div id="container">
<?php if(have_posts()) : ?>
<?php while(have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2>
<a href="<?php the_permalink(); ?>"title="<?php the_title(); ?>"><?php the_title(); ?></a>
</h2>
</div>
<div class="entry"><?php the_content(); ?></div>
<p class="postmetadata">
<?php _e('Filed under:'); ?> <?php the_category(', ') ?> <?php _e('by'); ?> <?php the_author(); ?><br />
<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
<?php edit_post_link('Edit', ' | ', ''); ?>
</p>
<?php endwhile; ?>
<div class="navigation"><?php posts_nav_link(); ?></div>
<?php else : ?>
<div class="post"><h2><?php _e('Not Found'); ?></h2></div>
<?php endif; ?>
</div>
CSS
.post{
padding: 10px 5px 0 5px;
background-image: url(images/toppost.png);
background-repeat:no-repeat !important;
}
.post h2{
font-family: Arial, Sans-serif;
font-size: 18px;
margin: 0px 0 0px 0px;
}
.entry{
background-image:url(images/ContentBG.png);
margin: 0 0 0 0;
padding:0 5px !important;
background-position: bottom;
}
.postmetadata {
clear: both;
background-image: url(images/post-footer.png);
background-repeat: no-repeat;
height:118px;
padding:0 5px !important;
}
你能發佈生成的HTML代碼嗎?有沒有標籤丟失? –
請發佈最終標記,而不是中間腳本 –