• Resolved Masteecate

    (@masteecate)


    I’ve tried everything but can’t seem to find how to remove a space between two div’s on my wordpress.

    I have higlighted the div with a yellow border so you can easely see what I mean.

    The strange thing is that the space only appears on single post’s.
    See https://masteecate.com/?p=7

    If you go back to the main page (click the logo) you can see the yellow box at the bottom with no space under it.

    This is my main index template:

    <?php get_header(); ?> 
    
                  <ul class="mcol">
                  <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
                  	<li class="article">
    
                        	<?php
                        	if ( has_post_thumbnail() ) { ?>
                        	<?php
                        	$imgsrcparam = array(
    						'alt'	=> trim(strip_tags( $post->post_excerpt )),
    						'title'	=> trim(strip_tags( $post->post_title )),
    						);
                        	$thumbID = get_the_post_thumbnail( $post->ID, 'background', $imgsrcparam ); ?>
                            <div><a href="<?php the_permalink() ?>" class="preview"><?php echo "$thumbID"; ?></a></div>
                        	<?php } ?>
    
                        <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
                        <?php the_excerpt(); ?>
                        <div class="postmetadata">
    			<!-- By: <?php the_author_posts_link(); ?><br /> -->
                            <?php the_time(__('F jS, Y', 'kubrick')) ?>&nbsp;ˑ&nbsp;
                            <?php comments_popup_link(__('No Comments'), __('1 Comment'), __('% Comments'), '', __('Comments Closed') ); ?><br />
                            <?php printf(__('Category: %s'), get_the_category_list(', ')); ?>
                        </div>
                    </li>
                <?php endwhile; ?>
                <?php else : ?>
                <?php endif; ?>
                </ul>
    
                <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
                <?php endwhile; ?>
                <?php else : ?>
                <div id="main">
                    <h1><?php _e("Sorry, but you are looking for something that isn’t here."); ?></h1>
                </div>
                <?php endif; ?>
    
                <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
                <?php endwhile; ?>
                    <div id="nav">
                        <div id="navleft"><?php next_posts_link(__('Previous page&nbsp;')) ?></div>
                        <div id="navright"><?php previous_posts_link(__('Next page&nbsp;')) ?></div>
                    </div>
                <?php else : ?>
                <?php endif; ?>
    
    <?php get_footer(); ?>

    And this is my single post

    <?php get_header(); ?> 
    
    <?php get_sidebar(); ?> 
    
                <div id="main-inner">
    
                  <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
                    <div class="article" id="post-<?php the_ID(); ?>">
    
                          <h1><?php the_title(); ?></h1>
                          <div class="postmetadata">
                             <!-- By: <?php the_author_posts_link(); ?>&nbsp;ˑ&nbsp; --> <?php the_time(__('F jS, Y')) ?>&nbsp;ˑ&nbsp;<?php printf(__('Category: %s'), get_the_category_list(', ')); ?>&nbsp;ˑ&nbsp;
                              <?php comments_popup_link(__('No Comments'), __('1 Comment'), __('% Comments'), '', __('Comments Closed') ); ?><?php edit_post_link(__('Edit this entry'), '&nbsp;ˑ&nbsp;', ''); ?>
                          </div>
                          <?php the_content(); ?>
                          <div class="postmetadata tags">
    					  		<?php the_tags(); ?>
                          </div>
    
                    </div>
    
                <?php endwhile; ?>
    
                    <div id="nav">
                        <div id="navleft"><?php previous_post_link('%link', 'Previous article'); ?></div>
                        <div id="navright"><?php next_post_link('%link', 'Next article'); ?></div>
                    </div>
    
    <?php comments_template(); ?>
    
                <?php else : ?>
                    <h1><?php _e("Sorry, but you are looking for something that isn’t here."); ?></h1>
                <?php endif; ?>
    
                </div>
    
    <?php get_footer(); ?>

    If you need any more code, please tell me.
    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • looks like part of it comes from your comment form

    you have browser specific stylesheets loading that pad the comment form – and your comment form only shows on the single view

    For instance, ie8.css has:

    #respond {
    	padding-top: 17px!important;
    }

    Using a tool such as firebug for firefox will let you dig into the css deeper and figure out exactly what is affecting formatting of specific elements.

    Thread Starter Masteecate

    (@masteecate)

    Thanks for the reply.

    I changed the padding-top to “0px”, both in ie8 and ie7 but it’s still the same.

    Thread Starter Masteecate

    (@masteecate)

    I added a “margin-bottom -17px” for the “.single #nav” and that seemed to fix it.

    Thanks for the help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Space between two div's, help me remove it.’ is closed to new replies.