Reputation: 171
So I have a box on the right side of the page which when clicked on different titles will take to different news articles on the page though I also have it so when articles within the website titles are clicked upon on the page that they will be taken to the source. At the moment though neither are working what is going wrong?
html
<a name="Anchor1"><a href="http://newsarticle.com">News Article</a></a>
Upvotes: 0
Views: 64
Reputation: 17743
Simply add an id
attribute to the link:
<a id="foo" href="http://newsarticle.com">News Article</a>
Then link to it like this:
<a href="#foo">link to foo</a>
Upvotes: 1
Reputation:
Use id attribute inside the link to have the same effect as name attribute
<a id="Anchor1" href="http://newsarticle.com">News Article</a>
Upvotes: 1
Reputation: 5412
<a>
elements are forbidden in HTML syntax.Example:
if you have a link ,
<a href="a.html">a<a href="b.html">b</a>c</a>
Browsers will parse it as,
<a href="a.html">a</a> <a href="b.html">b</a> c
Reference: Nested links are illegal.
Upvotes: 0