Written by 6:27 pm Coding

So apparently you can link hashed anchors to element ids

Somehow, in the last 15 years of web development, I missed the fact that you can point an anchor tag to the id of an element. I’ve always linked those to named anchors like this:

<p><a href="#blah">Go to Blah</a></p>
<p>.... some stuff .... </p>
<h1><a name="blah"></a>Here is blah</h1>

 

Instead of doing this:

<p><a href="#blah">Go to Blah</a></p>
<p>.... some stuff .... </p>
<h1 id="blah">Here is blah</h1>
Close