Note that there are some explanatory texts on larger screens.

plurals
  1. POSetting custom anchor point inside of HTML
    primarykey
    data
    text
    <p>I have seen this topic somewhat covered in posts <a href="https://stackoverflow.com/questions/9380034/setting-custom-anchorpoint">here</a> and <a href="https://stackoverflow.com/questions/9335942/anchor-point-positionings">here</a>, but they don't really help me out. The situation is fairly similar though: a scrolling page and a sticky menu bar (fixed div) at the top of the page, with anchor points scattered through the long scrolling text.</p> <p>Something like this HTML:</p> <pre><code>&lt;a name="hd1" class="anchor"&gt;&lt;h1&gt;Heading Foo&lt;/h1&gt;&lt;/a&gt; &lt;p&gt;this is some text, and a lot of it ... &lt;a href="#hd1"&gt;jump to Heading Foo&lt;/a&gt; ... &lt;a name="hdx" class="anchor"&gt;&lt;h1&gt;Heading Bla&lt;/h1&gt;&lt;/a&gt; &lt;p&gt;and then there is more text ... &lt;a href="#hdx"&gt;jump to Heading Bla&lt;/a&gt; ... </code></pre> <p>with some CSS that, for now, is empty because I still just stumble around this issue</p> <pre><code>.anchor { color: green; } ​ </code></pre> <p>Take a look at <a href="http://jsfiddle.net/QCv27/" rel="nofollow noreferrer">this</a> fiddle to see how it works at the moment.</p> <p>Now, whenever I click on a link it takes me to the anchor. (Yay!) Alas, this also means that the anchor, now at the top of the page, is covered by the sticky menu. (Nay!) It would be great if it would show <em>below</em> the sticky menu.</p> <p>I've tried the solutions that were given in the other posts to no avail. For example, adding padding around the anchor does actually add visible padding in the text and create empty space; which is not what I want. The text ought to appear unmodified visually.</p> <p>Thanks in advance for hints and tips :-)</p> <p>EDIT: I should make it a little more clear. I do <em>not</em> need space on top of the page. I do need <em>every</em> anchor point to be <em>below</em> the menu bar. Try my original fiddle, and click the anchors: you will see how they are positioned so that they are covered by the menu bar.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload