+ 1
What is name attribute of anchor tag?plz explain in detail?
4 ответов
+ 2
Hi Afreen Saba,
By including an anchor tag within a post or page, you can place links in the body of your page which when clicked allow the reader/user to jump to another location on the page.
# equals the name attribute
Syntax: (== is equal to)
#value == name="value"
# == name
value == value
<li><a href="#linkOne">Link one</a></li>
<li><a href="#linkTwo">Link two</a></li>
<div><a name="linkOne">Anchor one</a></div>
<span><a name="linkTwo">Anchor two</a></span>
Name attribute of anchor tag explained👍:
https://www.expression-web-tutorials.com/anchor-tags.html
Have a look at this source👍:
https://stackoverflow.com/questions/484719/should-i-make-html-anchors-with-name-or-id
Additional sources:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a
+ 2
Name attribute in anchor tag is obsoleted in HTML5, use id # instead.
More information please check
https://www.w3.org/TR/html5-diff/
" The following attributes are allowed but Web developers are discouraged from using them and instead strongly encouraged to use an alternative solution:
The border attribute on img. It is required to have the value "0" when present. Web developers can use CSS instead.
The language attribute on script. It is required to have the value "JavaScript" (case-insensitive) when present and cannot conflict with the type attribute. Web developers can simply omit it as it has no useful function.
The name attribute on a. Web developers can use the id attribute instead. "
+ 2
Hi,Vincent Berger
Thank you for explaining.
😄😄
+ 1
Calvin
thanks for giving me the answer