Title: Centering wrap
Last modified: August 20, 2016

---

# Centering wrap

 *  Resolved [navyspitfire](https://wordpress.org/support/users/navyspitfire/)
 * (@navyspitfire)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/centering-wrap/)
 * Don’t mean to beat a dead horse, but I can’t get topic to work. I’ve even emulated
   the twentyeleven theme, and it’s still not working.
 * header.php
 *     ```
       <body <?php body_class(); ?>>
   
       <div id="container">
   
       	<div id="header">
               <h1>
                   <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
               </h1>
               <p><?php bloginfo( 'description' ); ?></p>
   
               <div id="access" role="navigation">
                 <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
                   <a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a>
                   <?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.  */ ?>
                   <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
               </div><!------------------END #access ------------------------>
   
           </div> <!------------------- END #header ------------------------------>
       ```
   
 * footer.php
 *     ```
       <?php
       /**
        * The template for displaying the footer.
        *
        * Contains the closing of the id=main div and all content
        * after.  Calls sidebar-footer.php for bottom widgets.
        *
        * @package WordPress
        * @subpackage Starkers
        * @since Starkers 3.0
        */
       ?>
   
       <?php
       	/* A sidebar in the footer? Yep. You can can customize
       	 * your footer with four columns of widgets.
       	 */
       	get_sidebar( 'footer' );
       ?>
   
       			<a href="<?php echo home_url( '/' ) ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
       			<a href="http://wordpress.org/" title="Semantic Personal Publishing Platform" rel="generator">Proudly powered by WordPress </a>
   
       </div> <!------------------- END #container ------------------------------>
   
       <?php
       	/* Always have wp_footer() just before the closing </body>
       	 * tag of your theme, or you will break many plugins, which
       	 * generally use this hook to reference JavaScript files.
       	 */
   
       	wp_footer();
       ?>
   
       </body>
       </html>
       ```
   
 * style.css
 *     ```
       @import "css/reset.css";
       @import "css/typography.css";
       @import "css/layout.css";
   
       body {
       	background-color: gray;
       }
   
       #container {
       	width: 960px;
       	margin: 0 auto;
       }
   
       /*-------- HEADER
       ------------------------------------------------------------------------------*/
   
       #header {
       	height: 250px;
       	background-color: rgb(0,153,153);
       }
       ```
   

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

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [13 years, 9 months ago](https://wordpress.org/support/topic/centering-wrap/#post-2953048)
 * Which element do you want centred?
    And could you Pastebin.com the HTML from 
   the view-source of the web page?
 *  Thread Starter [navyspitfire](https://wordpress.org/support/users/navyspitfire/)
 * (@navyspitfire)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/centering-wrap/#post-2953058)
 * Well, the container is gonna be centered; as it stands now it is not, everything
   is to the left of the screen.
 * [http://pastebin.com/U7KKVUTG](http://pastebin.com/U7KKVUTG)
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [13 years, 9 months ago](https://wordpress.org/support/topic/centering-wrap/#post-2953062)
 * Analysing your HTML, it seems you have yet to use a `<div>` element with the 
   id value of “container”.
 *  Thread Starter [navyspitfire](https://wordpress.org/support/users/navyspitfire/)
 * (@navyspitfire)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/centering-wrap/#post-2953063)
 * What about the div I declare in my header.php, right below the <body>?
 *  Thread Starter [navyspitfire](https://wordpress.org/support/users/navyspitfire/)
 * (@navyspitfire)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/centering-wrap/#post-2953065)
 * You know I think I found the problem… it’s in Dreamweaver.
 *  Thread Starter [navyspitfire](https://wordpress.org/support/users/navyspitfire/)
 * (@navyspitfire)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/centering-wrap/#post-2953133)
 * Figured it out, files weren’t uploading.

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

The topic ‘Centering wrap’ is closed to new replies.

## Tags

 * [center](https://wordpress.org/support/topic-tag/center/)
 * [centering](https://wordpress.org/support/topic-tag/centering/)
 * [container](https://wordpress.org/support/topic-tag/container/)
 * [wrap](https://wordpress.org/support/topic-tag/wrap/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [navyspitfire](https://wordpress.org/support/users/navyspitfire/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/centering-wrap/#post-2953133)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
