cakephp / docs

CakePHP CookBook
http://book.cakephp.org
Other
680 stars 2.58k forks source link

Anchors are hidden behind the nav-bar. #4010

Closed ndm2 closed 8 years ago

ndm2 commented 8 years ago

When visiting an anchor, like this for example, the targeted element is being hidden by the nav-bar, which can be a little confusing (same problem in the API docs).

Having the nav-bar expand when scrolling upwards adds some additional annoyance in this case, as the target is going to be hidden even more.

hidden-anchor

hidden-anchor-transparency

markstory commented 8 years ago

Fixing this is going to be tricky. In order to get the sticky header it needs to be fixed/absolute position which interacts poorly with anchor behavior in browsers.

ndm2 commented 8 years ago

Yeah, I know... I'm usually using JS, or hidden, offset anchors to work around this without having to adjust the content layout.

ADmad commented 8 years ago

This CSS trick might be the solution https://www.itsupportguides.com/tech-tips-tricks/how-to-offset-anchor-tag-link-using-css/

markstory commented 8 years ago

Nice find @ADmad! that works really well in Firefox. I'll test it some more in other browsers, and if it works push up a fix.

markstory commented 8 years ago

Fixed on the 2.x and 3.x docs.