Forums

[resolved] Divs with graphics above and below content div - one shows, one doesn't (7 posts)

  1. David Borrink
    Member
    Posted 3 years ago #

    I need a fresh pair of eyes to see if I'm overlooking something obvious.

    Something is interfering with some graphic divs I'm using to create rounded corners. The top div graphics are showing up on top of the content area background, but the bottom div graphics aren't.

    I've gone over my css and my template pages to see why it's not working and I must be blind to something. I've double-checked my spellings, etc.

    Here's a link to the site in development.

    On the "home" page I have some custom content blocks and you can see the top and bottom pairs of round corners working well. But go to any other page and you'll see the bottom pair of rounded corners not working. Very baffling.

    Here's the basic template structure of the content block for the regular pages (with notes) :

    ` <div id="contentwrapper">

    <!-- this is the top pair of rounded corners -->
    <div id="feature-top">
    </div>

    <!-- this is the content area -->
    <div id="content" class="narrowcolumn">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    <h2><?php the_title(); ?></h2>
    <div class="entry">
    <?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>

    <?php wp_link_pages(array('before' => '<p>Pages: ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

    </div>
    </div>
    <?php endwhile; endif; ?>
    <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    </div>

    <!-- this is the bottom pair of rounded corners -->
    <div id="feature-bottom">
    </div>

    </div>`

    And here's the CSS for these items:

    #contentwrapper {
    	float: right;
    	margin: 0px 24px 1px 0px;
    	width: 620px;
    	background: none;
    	}
    
    #feature-top {
    	background: url('images/feature-top.gif') no-repeat top center;
    	height: 13px;
    	}
    
    .narrowcolumn {
    	background: #eadf9b;
    	float: right;
    	padding: 0 24px 20px 24px;
    	width: 572px;
    	}
    
    #feature-bottom {
    	background: url('images/feature-bottom.gif') no-repeat top center;
    	height: 13px;
    	}
  2. stvwlf
    Member
    Posted 3 years ago #

    Error calling your link:

    Firefox can't find the server at dev.brightideaspress.com.

  3. David Borrink
    Member
    Posted 3 years ago #

    I just clicked on the link and it works. Not sure why you weren't able to get it.

  4. stvwlf
    Member
    Posted 3 years ago #

    Hi - the link is working now. Must have been a server hiccup.

    On http://dev.brightideaspress.com/?page_id=5
    Using View Source I am seeing the Div-close tag for Div Page coming after the end of the page

    </body>
    </html>
    </div>

    Try rearranging that.

    Also, if you have any pages with more than one post per page you need to move your rounded corner div's inside The Loop. Otherwise the top corners appear only on the first post and the bottom only on the last post.

  5. David Borrink
    Member
    Posted 3 years ago #

    Thanks, stvwlf,

    Great catch using View Source. I know how that happened. I had to move the footer inside the page in order to force the background past both floating divs and reach the bottom. I needed a non-floating div to do that and the footer was the candidate.

    Didn't realize that would put the page div after the body and html tags.

    Not getting the bottom corners yet, but I'm going to try putting the bottom corner art in the "narrowcolumn" div and set it to no-repeat bottom center to have it appear IN the content div at the end, and not in a separate div after the content div.

  6. David Borrink
    Member
    Posted 3 years ago #

    And that worked. I now have rounded corners on the bottom. Guess I didn't need a third div in there.

    I'm not sure why it works on my front page content blocks and my sidebar, but not on standard pages and posts, but oh well.

    Thanks for your time!

  7. stvwlf
    Member
    Posted 3 years ago #

    hi - my pleasure...

    If you trace the code flow of the homepage and the standard posts most likely you will find a subtle difference. Validate your pages and see if there are any errors - as you noticed, a div in the wrong place can have unexpected side effects.

Topic Closed

This topic has been closed to new replies.

About this Topic