Re:Kill sticky headers (2013)
by nathancahill on Tuesday June 27, 2017 @02:41PM
(#14648040)
The fix is to shift the anchor to above the header.
Re:Kill sticky headers (2013)
by JoshTriplett on Tuesday June 27, 2017 @02:45PM
(#14648081)
Can you elaborate on what you mean by this? Because I can think of a couple of meanings of "above" there, none of which seem like they'd have the desired effect.
It confused me at first too, but now I think I know what he means. Before the header you're linking to - h3 or whatever. Link to some content enough above that header to compensate for the sticky header.
Re:Kill sticky headers (2013)
by JoshTriplett on Tuesday June 27, 2017 @03:56PM
(#14648798)
That seems like an awkward semantic break to compensation for presentation, as well as error-prone in size-matching.
Better if the browser knew about the header and could position the linked anchor accordingly. In the absence of any facility to do that, just ditch the header.
It actually is possible to do - you can use CSS to move the position of the anchor tag. If I recall there were some extra CSS properties needed to make it work, but it can be done.
Or, add padding to the top of the H3 to compensate for the sticky header.
Re:Kill sticky headers (2013)
by awinter-py on Tuesday June 27, 2017 @04:19PM
(#14649000)
yeah, or just
* {margin:2em}
Re:Kill sticky headers (2013)
by microcolonel on Tuesday June 27, 2017 @06:46PM
(#14650254)
That would break the most common method of centering the main content (margin-left: auto; margin-right: auto)
This, especially. If the browser were somehow informed about the header in a semantic way, it could avoid this.