Hello, I am new to these forums so forgive me please if I have posted this in the wrong area.

My question is how do I make a link into a heading properly?

When I used <a href="#"><h1>Heading</h1></a>, the link did not work, and sent me to a random page.

When I used <h1><a href="#">Heading</a></h1>, the css seemed to not work as a heading but as a link, and I am not sure of how to make a css rule for a heading in a link.