[wp-trac] [WordPress Trac] #42300: Admin Bar CSS assumes body is not positioned

WordPress Trac noreply at wordpress.org
Sat Oct 21 23:59:03 UTC 2017


#42300: Admin Bar CSS assumes body is not positioned
--------------------------+-----------------------------
 Reporter:  joyously      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Toolbar       |    Version:  4.5.7
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The Admin Bar is appended to the `body` of the page, and uses `position:
 fixed` for large windows. A space is made for it by using `margin-top` on
 the `html` tag.
 This works fine until the media query for smaller windows changes it to
 `position: absolute` and there is user or theme CSS with `body {position:
 relative}`. The bar is then positioned relative to the body instead of
 html (leaving the margin visible and the bar over the top of body
 content).

 I discovered this because I wanted to add a background overlay on the
 body, independent of the custom background, so I set the body position to
 relative and body:before to absolute.

 A possible solution is to use body padding instead of html margin, but
 that might interfere more with theme CSS than the current method.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42300>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list