Title: Sidebar Positioning Issues
Last modified: August 21, 2016

---

# Sidebar Positioning Issues

 *  Resolved [buckylulu](https://wordpress.org/support/users/buckylulu/)
 * (@buckylulu)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/sidebar-positioning-issues-1/)
 * I am having the same issue on a theme I am working on. This is the code for the
   page:
 *     ```
       <body>
       <?php get_header(); ?>
         <div id="page-wrap">
           <div id="contentPage">
       	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
       		<div class="post" id="post-<?php the_ID(); ?>">
       			<h3><a href="<?php echo get_option('home'); ?>/">Home</a> &raquo; <b><?php the_title(); ?></b></h3>
       			<hr />
       			<div class="entry">
       				<?php the_content(); ?>
       				<?php wp_link_pages(array('before' => 'Pages: ', 'next_or_number' => 'number')); ?>
       			</div>
       			<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
       		</div>
       	<?php endwhile; endif; ?>
         </div>
         <div id="rightnav" class="sidebar">
       		<?php get_sidebar(); ?>
         </div>
       </div>
       </body>
       <?php get_footer(); ?>
       ```
   
 * And here are my css rules:
 *     ```
       #page-wrap {
       	width: 80%;
       	margin-left: auto;
           margin-right: auto;
           margin-bottom: 30px;
       }
   
       #contentPage {
       	margin: 0 45px 30px 0;
       	padding:0 45px 0 0;
       	width:65%;
       }
   
       #rightnav {
       	float: right;
       	width: 25%;
       	margin: 0;
       	padding: 1em;
       }
   
       .sidebar {
       	float:right;
       	margin: 0;
       	padding: 0;
       	vertical-align: top;
       	clear: right;
       }
       ```
   
 * Here is what [the site currently looks like](http://water-optimizer.com/_2013/water-optimizer/).
   Am I missing something?

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/sidebar-positioning-issues-1/#post-3951131)
 * Try sorting out any markup errors. Then move onto any CSS errors.
    [http://codex.wordpress.org/Validating_a_Website](http://codex.wordpress.org/Validating_a_Website)
 *  Thread Starter [buckylulu](https://wordpress.org/support/users/buckylulu/)
 * (@buckylulu)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/sidebar-positioning-issues-1/#post-3951262)
 * I went ahead and did some validating, but it still isn’t positioning correctly.
   I am a css novice, so please any and all advice is welcomed! Thanks.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 9 months ago](https://wordpress.org/support/topic/sidebar-positioning-issues-1/#post-3951263)
 * You may want to first resolve your HTML errors before CSS.
    Look at using doctypes:
   [http://www.w3schools.com/tags/tag_doctype.asp](http://www.w3schools.com/tags/tag_doctype.asp).
 *  Thread Starter [buckylulu](https://wordpress.org/support/users/buckylulu/)
 * (@buckylulu)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/sidebar-positioning-issues-1/#post-3951270)
 * I did and then the report came back with 3 errors that I haven’t been able to
   find in any of my code. I downloaded the newest version of wordpress, switched
   all doctype to fit html5; what else am I not seeing here?
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [12 years, 9 months ago](https://wordpress.org/support/topic/sidebar-positioning-issues-1/#post-3951271)
 * You don’t have a “html” element in the right place & you have a duplicate doctype.
   All we can do is suggest you resolve your HTML errors.
 *  Thread Starter [buckylulu](https://wordpress.org/support/users/buckylulu/)
 * (@buckylulu)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/sidebar-positioning-issues-1/#post-3951336)
 * Where would I properly place it? When validating, I feel like this is also taking
   the current site and picking up errors. I want to just be working with the wp
   theme and not anything else that is within this site. I don’t see how that could
   be posing an issue, though, since the wp theme isn’t pulling anything from the
   current (albeit HTML) site.
 * All in all, is my coding correct? Thanks again!
 *  [CrouchingBruin](https://wordpress.org/support/users/crouchingbruin/)
 * (@crouchingbruin)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/sidebar-positioning-issues-1/#post-3951346)
 * Just doing a **View Source** on your site, you have 2 DIVs with an ID of **page**
   and 2 DIVs with an ID of **sidebar** (although one is nested inside the other).
 * As far as the sidebar positioning goes, you might try having **#contentPage**
   float:left instead of **sidebar** float:right. But there are other problems that
   need to be fixed.
 *  Thread Starter [buckylulu](https://wordpress.org/support/users/buckylulu/)
 * (@buckylulu)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/sidebar-positioning-issues-1/#post-3951394)
 * thanks, [@crouchingbruin](https://wordpress.org/support/users/crouchingbruin/),
   that seemed to work…but now the footer bar moved up and the content is all messed
   up. ugh…i’m pretty sure that once this is figured out, i’ll be a happy camper!
 *  Thread Starter [buckylulu](https://wordpress.org/support/users/buckylulu/)
 * (@buckylulu)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/sidebar-positioning-issues-1/#post-3951398)
 * it appears that all i had to do was add a <div class=”clear” /> and that seemed
   to work! thanks for all of your help!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Sidebar Positioning Issues’ is closed to new replies.

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [positioning](https://wordpress.org/support/topic-tag/positioning/)
 * [sidebar](https://wordpress.org/support/topic-tag/sidebar/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 4 participants
 * Last reply from: [buckylulu](https://wordpress.org/support/users/buckylulu/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/sidebar-positioning-issues-1/#post-3951398)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
