Title: Custom header widget size problem&#8230;
Last modified: August 20, 2016

---

# Custom header widget size problem…

 *  Resolved [sandra408](https://wordpress.org/support/users/sandra408/)
 * (@sandra408)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/custom-header-widget-size-problem/)
 * Hi.
    I added a widget for my header. But it stretches all the way across the 
   top, so does not react to it’s size dimensions or a z-index position… Have no
   idea what I did wrong.
 * Here is the functions.php file code:
 *     ```
       register_sidebar( array(
           'name' => __( 'Header Widget Area Left', 'My-Theme-Name' ),
           'id' => 'header-widget-area-left',
           'description' => __( 'The header left widget area', 'my-theme-name' ),
           'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
           'after_widget' => '</li>',
           'before_title' => '<h3 class="widget-title">',
           'after_title' => '</h3>',
       ) );
       ```
   
 * Here is what I put in the header:
 *     ```
       <?php
   
       if ( is_active_sidebar( 'header-widget-area-left' )) {
   
       dynamic_sidebar( 'header-widget-area-left' );
       }
       ?>
       ```
   
 * And here is CSS:
 *     ```
       #header-widget-area-left {
           float: left;
           position: absolute;
           width: 150px;
           height: 233px;
           z-index: 50;
       }
       ```
   
 * Any ideas?
 * Thanks.

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

 *  [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * (@swansonphotos)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/custom-header-widget-size-problem/#post-2416545)
 * `My-Theme-Name` v. `my-theme-name` ?
 *  Thread Starter [sandra408](https://wordpress.org/support/users/sandra408/)
 * (@sandra408)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/custom-header-widget-size-problem/#post-2416549)
 * I resolved it by putting php code in <div> tags and giving <div> an id …
 * Here is CSS:
 *     ```
       #header-left-widget-holder {
           height: 233px;
           width: 150px;
           margin: 23px 0 40px 40px;
           position: absolute;
           z-index: 50;
       }
       ```
   

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

The topic ‘Custom header widget size problem…’ is closed to new replies.

## Tags

 * [header widget](https://wordpress.org/support/topic-tag/header-widget/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [sandra408](https://wordpress.org/support/users/sandra408/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/custom-header-widget-size-problem/#post-2416549)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
