h2 header displaying below page content
I have been modifying a wordpress theme and as I just began to put content in the pages, I noticed the h2 header is displaying below the content (see here:http://mefo1.ecin1prod1lnx1.com/about/history/). I can't seem to find an explanation.
Below is the page.php code. I am happy to PasteBin any other code that might be needed.
Thank you very much,
Alex
<?php get_header(); ?>
<script>
jQuery(document).ready(function(){
jQuery(".share").click(function(){
jQuery(this).next("div").slideToggle("slow");
jQuery(this).toggleClass("active"); return false;
});
});
</script>
<div class="posts-column">
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<?php include(TEMPLATEPATH . '/includes/share.php'); ?>
<div class="entry">
<?php the_content(); ?>
</div>
<div class="clear"></div>
<?php endwhile ?>
<div class=开发者_C百科"clear"></div>
<h2 class="page"><?php the_title(); ?></h2>
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
<?php endif; ?>
</div><!--end posts-column-->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Move above your div class entry
Read what @Shaun said. Remember, divs are block elements by default which means they will grow to take up as much room as they need. This forces any sibling blocks to start below unless otherwise specified through css. Move your h2 to the top of the document. Normal document flow is left to right, top to bottom so your first div (with class "entry") will be displayed as a block level element (since you didn't specify otherwise) and it's sibling will be rendered below hence why your h2 element is not where you expect.
精彩评论