[wp-trac] [WordPress Trac] #16222: When admin bar is active, switch body padding-top to margin-top

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 25 22:04:51 UTC 2011


#16222: When admin bar is active, switch body padding-top to margin-top
--------------------------+----------------------
 Reporter:  koopersmith   |       Owner:  aldenta
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  3.1
Component:  General       |     Version:  3.1
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |
--------------------------+----------------------

Comment (by WraithKenny):

 There's a general issue with using css layouts with `html, body
 {height:100%}` but then assigning `padding-top:28px;` (etc) on either
 element... the element will then have > 100% height and induce (probably)
 unwanted/unneeded scroll-bars.

 This is evident using 3.1-RC3 with Admin Bar enabled for Admin pages (in
 user profile settings). The solution for the admin page is to remove the
 `28px` padding on body and instead assign it to `#wphead`.

 For Themes, we can't predict the layout used unless the theme registers
 support (`current_theme_supports( 'admin-bar' )`). If a theme does
 register support, we can assume they added appropriate padding to an
 appropriate element, and it wouldn't need any injected css from WP core at
 all.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16222#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list