4 replies [Last post]
gautamz07
gautamz07's picture
Offline
Enthusiast
Last seen: 4 years 45 weeks ago
Timezone: GMT+5.5
Joined: 2014-04-24
Posts: 265
Points: 403

read this about the tag

    In HTML 4.01, the <a> tag could be either a hyperlink or an anchor. In HTML5, the <a> tag is always a hyperlink, but if it has no href attribute, it is only a placeholder for a hyperlink.

what does "Don't use as an anchor (target for a link) in HTML5." mean ?

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 3 days 5 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Hi gautamz07, You can use any

Hi gautamz07,
You can use any element with an id as a target for a link.

<a href="#content">Skiplink to content</a>
 
<div id="content">...</div>

Just make sure the id is unique on the page.

gautamz07
gautamz07's picture
Offline
Enthusiast
Last seen: 4 years 45 weeks ago
Timezone: GMT+5.5
Joined: 2014-04-24
Posts: 265
Points: 403

@Tony whats the difference between a hyperlink and an anchor ?

@Tony whats the difference between a hyperlink and an anchor ?

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 3 days 5 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

A hyperlink is a link eg <a

A hyperlink is a link eg <a href="">
An anchor is a uniquly named element on a page you can target with #. https://csscreator.com/content/html5-anchor-name-target

gautamz07
gautamz07's picture
Offline
Enthusiast
Last seen: 4 years 45 weeks ago
Timezone: GMT+5.5
Joined: 2014-04-24
Posts: 265
Points: 403

@Tony

Thanks alot . thats clears my doubt.