Home > Article > Web Front-end > Which of id and name is the standard usage for marking anchor points? _html/css_WEB-ITnose
Not found.
Don’t understand what you mean?
Don’t understand what you mean?
content
content
You add# What does the number mean? When you write an id, you either need to set a style for it separately or to get a value. When you write a name, you usually want to get a value.
What does the # sign mean when you add an id? It sets the style, or it needs to get the value. Writing name is usually to get the value
I made a typo, there is no #. This is not a style.
It’s mainly about what you want to do
I’ve told you how to use it, it’s up to you how to use it, please give me points after finishing the post
It’s mainly about what you want to do Why
go to Baidu “anchor” yourself. What I want is standards.
It is recommended to use id, follow xhtml rules, and is supported in IE, Firefox, Chrome, and Opera. The name attribute has restrictions compared to tags
It is recommended to use id, follow xhtml rules, and is supported in IE, Firefox, Chrome, and Opera. There are restrictions on the name attribute compared to the label
http://stackoverflow.com/questions/484719/html-anchors-with-name-or-id
Found something. It's too long. Let's read it tomorrow.
According to the standard, as the anchor point of positioning, the position is generally unique, so the name should be unique, so using ID is more standardized than NAME. This is HTML5's response to The reason for the cleanup.
If you don’t consider HTML5, there is no need to discuss this issue, because regardless of whether the specification is standardized or not, it is indeed effective and its existence is reasonable.
And if you consider it As for HTML5, there is nothing to discuss, because is no longer recognized by it.