treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Problem with divs in single.php (Wordpress)

  • Hey,

    I am working on a new design for my movie blog, the work in progress can be found here: http://test.filmabend.info

    I have a problemm with my single.php and specifically the way Firefox displays it:

    I want the commentform to appear within the white background of the "post" div, that means the bottom with the rounded corners

    <div class=\"entrybottom\">


    should appear AFTER the comments and AFTER the comment form.

    Here is my single.php code:

    <?php get_header(); ?>

    <div id=\"main\">
    <div id=\"content\">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div class=\"post\" id=\"post-<?php the_ID(); ?>\">
    <div id=\"entryheader\">

    <div class=\"entry-date\">
    <div class=\"entry-month\"><?php the_time('F'); ?></div>
    <div class=\"entry-day\"><?php the_time('j'); ?></div>
    <div class=\"entry-year\"><?php the_time('Y'); ?></div>
    </div>

    <div id=\"entrytitle\"><h2><a href=\"<?php the_permalink() ?>\" rel=\"bookmark\" title=\"Permanent Link to <?php the_title(); ?>\"><?php the_title(); ?></a></h2> </div>
    </div>

    <div class=\"entry-content\">
    <?php the_content('Weiterlesen...'); ?>
    <?php edit_post_link('Edit','<p>','</p>'); ?>

    <div class=\"entryfooter\">

    <div id=\"footerblock\"></div>
    <div class=\"avatar\"><?php echo get_avatar( get_the_author_email(), '60' ); ?></div>
    <div class=\"entryinfo\">

    <p>Ver&ouml;ffentlicht von <?php the_author() ?> am <?php the_time('d. F Y') ?> um <?php the_time('H:i') ?> Uhr in <?php the_category(', ') ?> | <?php the_tags( 'Tags: ', ', '); ?></p>

    </div>
    <div id=\"commentbubble\">
    <div class=\"commentcount\"><a href=\"<?php the_permalink(); ?>#comments\"><?php comments_number('0', '1', '%'); ?></a></div>
    <div class=\"commenttext\"><a href=\"<?php the_permalink(); ?>#comments\"><?php comments_number('Kommentare', 'Kommentar', 'Kommentare'); ?></a></div>
    </div>
    </div>
    <div class: \"clear\"></div>

    <?php comments_template(); ?>

    <div class=\"entrybottom\"></div>
    </div>
    <?php wp_link_pages();?>



    </div>



    <?php endwhile; else: ?>

    <p>Sorry, no posts matched your criteria.</p>

    <?php endif; ?>



    </div> <!-- end content div-->
    <?php get_sidebar(); ?>
    </div> <!-- end the main div-->
    <?php get_footer(); ?>


    The funny thing is that it works the way i want it in IE7, but not in Firefox, Firefox will push the fields for the commentform outside of the background...

    First i thought i closed too many divs or something, but i can`t find my mistake. Would be nice if someone could help.

    Thanks,
    omaha
  • Add overflow: hidden to .entrybottom and validate your html.
  • I personally prefer
    clear:both


    Overflow:hidden seems like an accident that was not originally intended to work that way... and I don't know how to use it right ;). It looks like either one would work here.

    Using clear both would make your bottom div CSS:

    .entrybottom {
    background:transparent url(images/layout/entrybottom.png) repeat scroll 0 0;
    clear:both;
    height:21px;
    width:661px;
    }
  • Thanks for the help, it really works and i went for the
    clear: both;
    solution.

    Thanks again :)