News for hackers. Stuff that matters.
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.
Re:Kill sticky headers (2013) by cevn on Tuesday June 27, 2017 @02:51PM (#14648135)
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.

Re:Kill sticky headers (2013) by untog on Tuesday June 27, 2017 @06:05PM (#14649961)
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.
Re:Kill sticky headers (2013) by Andrex on Tuesday June 27, 2017 @02:55PM (#14648157)
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)
Re:Kill sticky headers (2013) by majewsky on Wednesday June 28, 2017 @05:39AM (#14652823)
Not necessarily. A more specific selector overrides a less specific one, and a later selector overrides an earlier one.