Title: Issues with admin bar
Last modified: August 20, 2016

---

# Issues with admin bar

 *  [Michael](https://wordpress.org/support/users/deflect/)
 * (@deflect)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/issues-with-admin-bar/)
 * WordPress v3.3,
    Website: [http://test.spartabots.co.cc](http://test.spartabots.co.cc)
 * The problem:
    When I upgraded to WordPress 3.3, the admin bar started mucking
   up some of my CSS. I think I’ve isolated the fact to how WordPress adds
 *     ```
       <style type="text/css" media="screen">
       	html { margin-top: 28px !important; }
       	* html body { margin-top: 28px !important; }
       </style>
       ```
   
 * to each webpage.
 * I’ve tried adding
 *     ```
       function fb_adjust_admin_bar() { ?>
       	<style type="text/css" media="screen">
       		html{
       			margin-top:0 !important;
       		}
       		* body body{
       			margin-top:0 !important;
       		}
       	</style> <?php
       }
       add_action( 'wp_head', 'fb_adjust_admin_bar' );
       '
       to functions.php, but now every webpage just displays
       ```
   
 * <style type=”text/css” media=”screen”>
    html{ margin-top:0 !important; } * body
   body{ margin-top:0 !important; } </style> <style type=”text/css” media=”print”
   >#wpadminbar { display:none; }</style> <style type=”text/css” media=”screen”>
   html { margin-top: 28px !important; } * html body { margin-top: 28px !important;}
   </style>`
 * How do I fix this?

Viewing 1 replies (of 1 total)

 *  Thread Starter [Michael](https://wordpress.org/support/users/deflect/)
 * (@deflect)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/issues-with-admin-bar/#post-2470973)
 * Sorry, I misposted slightly (and couldn’t find an edit feature).
 * I meant to say, after trying adding
 *     ```
       function fb_adjust_admin_bar() { ?>
       	<style type="text/css" media="screen">
       		html{
       			margin-top:0 !important;
       		}
       		* body body{
       			margin-top:0 !important;
       		}
       	</style> <?php
       }
       add_action( 'wp_head', 'fb_adjust_admin_bar' );
       ```
   
 * to functions.php, every webpage just displays
 *     ```
       <style type="text/css" media="screen">
       	html{ margin-top:0 !important; }
       	* body body{ margin-top:0 !important; }
       </style>
       <style type="text/css" media="print">#wpadminbar { display:none; }</style>
       <style type="text/css" media="screen">
       	html { margin-top: 28px !important; }
       	* html body { margin-top: 28px !important; }
       </style>
       ```
   
 * …and the lower style overrides the upper one.
 * How do I fix this?

Viewing 1 replies (of 1 total)

The topic ‘Issues with admin bar’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [Michael](https://wordpress.org/support/users/deflect/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/issues-with-admin-bar/#post-2470973)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
