<a href="http://www.website.com"><h1><a id="Didn't-answer-your-question?">Didn't answer your question?</a><!--ID end--></h1></a><!--link end-->
Can I have an id element inside a href element, for the link text or does this not work, if so do people have an alternative?
There are several problems with your markup.
You don't close the <h1>
tag properly. Your <a>
id
may technically work, but I wouldn't recommend it as an element ID.
The one that's giving you an issue though is the fact that you have an <a>
tag nested inside another <a>
tag. That is not valid markup.
Your inner tag does not need to be an anchor tag, change it to a span or something and it should work fine.
<a href="http://www.website.com">
<h1>
<span id="Didn't-answer-your-question??">Didn't answer your question?</span>
<!--ID end-->
</h1>
</a>
<!--link end-->