Closed searene closed 1 year ago
I have reproduced this in my Chrome browser.
But it shouldn't happen, the latest fix for #158 is
Using scroll-margin-top
for all HTML elements have id
attribute to fix the problem. As shown in the screenshot below, the <mjx-mtd>
element also has id
attribute, but this CSS rule doesn't apply!
Then I tested this in my Safari browser and it works normally. So I think this is a upstream browser bug which caused scroll-margin-top
doesn't apply to custom HTML elements.
@reuixiy Thanks for the reply! I actually ran the webpage in Edge, and it didn't work either. Maybe it's because Edge and Chrome are the same at the core. Considering that most upstream browsers usually take a long time to fix a bug, I don't expect this bug to be fixed by them soon. So maybe we can find a way to work around the problem in the meantime. For example, can we give the user an option to stop fixing the header at the top? It could be like the header in Hacker News, the header won't move along when the user scrolls up or down. It's just like other parts of the webpage, when the user scrolls away, it disappears. It has two advantages:
Please kindly consider this suggestion :)
Yes you can customize it by yourself, simply adding
.header {
position: relative;
}
.main {
padding-top: 3em;
}
to your ~/blog/assets/scss/custom/_custom.scss
file.
See https://github.com/reuixiy/hugo-theme-meme#customize-meme
@reuixiy I just tried it, and it worked! Thanks for the solution!
Here is a sample markdown text for illustrating my point:
The
$\eqref{1}$
part is a link, when the user clicks on the link, the webpage should jump to the equation marked with\tag{1}
. It works as expected, only that the target equation is at the top of the page, and the header is also at the top of the page, so the header blocks the target equation.There is no such problem when clicking on markdown headers, it might have been fixed with issues like https://github.com/reuixiy/hugo-theme-meme/pull/158. Could this issue be solved in the same way?
I recorded a video to illustrate my point:
https://github.com/reuixiy/hugo-theme-meme/assets/3351317/82d331e2-5e0b-4e88-b00a-7a50ed3f83dd
You can also find those texts on this webpage for testing.
Thanks in advance!