Hacker News new | past | comments | ask | show | jobs | submit login

  > document.querySelectorAll('[id]').length
  0
That caught me by surprise. Especially when it has its class entry-center to indicate “this is the actively focused message”, to not load to that point in the page or at least have an ID to jump to there seems surprising.

(A pure CSS solution for centering it on the page with an anchor: make the .entry-center `position: relative`, and give it a new child <div id=jump> with CSS `position: absolute; top: calc(50% - 50vh)`. The downside is that if the entire .entry-center is taller than the viewport, it will still be centered on the page, rather than sitting at the top. I suspect that defect could be solved if you used two nodes instead of just one, combining margin and padding, since padding can’t be negative.)




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: