[wp-trac] [WordPress Trac] #26609: Admin Bar pushed down at screens of 600px width and lower on the frontside

WordPress Trac noreply at wordpress.org
Sat Dec 14 06:48:53 UTC 2013


#26609: Admin Bar pushed down at screens of 600px width and lower on the frontside
-------------------------------+------------------------------
 Reporter:  Funkatronic        |       Owner:
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Toolbar            |     Version:  3.8
 Severity:  normal             |  Resolution:  invalid
 Keywords:  reporter-feedback  |
-------------------------------+------------------------------

Comment (by Veraxus):

 Confirming this problem.

 At 600px, `#wpadminbar` is changed from `position:fixed` to
 `position:absolute`.

 In CSS, fixed position is always relative to the window, whereas absolute
 positioning is relative to the first ancestor element with a non-static
 position.

 Many major front-end frameworks and boilerplates use positioning overrides
 ( e.g. `position:relative` ) on the `html` and/or `body` elements as
 routine corrective/normalization practice - so when the admin bar changes
 from `fixed` to `absolute` positioning, it does '''not''' snap to the top
 of the ''window'' as expected, but to the top of the `body` element, which
 has been shifted 46px from the top of the window due to the top margin.

 Considering how commonplace explicit `body` element positioning is as a
 routine normalization practice, I would say that this constitutes a
 serious problem/oversight.

 To fix this, the top margin for <code>html</code> should be set to
 <code>0</code> at <code>max-width:600px</code> to ensure there are no
 conflicts.

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


More information about the wp-trac mailing list