I have a few <a name="something"></a>
entries in my html page to enable page anchors; Visual Studio 2010 (with either HTML 4.01 or HTML 5 target) underlines name
attribute and shows warning "Element 'name' is obsolete or nonstandard".
Am I doing anything wrong? Is in-page anchoring deprecated?
Page anchors should now be done with ID
attributes.
This is something that has been obsoleted in the draft for HTML 5:
Authors should not specify the name attribute on a elements. If the attribute is present, its value must not be the empty string and must neither be equal to the value of any of the IDs in the element's home subtree other than the element's own ID, if any, nor be equal to the value of any of the other name attributes on a elements in the element's home subtree. If this attribute is present and the element has an ID, then the attribute's value must be equal to the element's ID. In earlier versions of the language, this attribute was intended as a way to specify possible targets for fragment identifiers in URLs. The id attribute should be used instead.
The name
attribute is actually valid HTML 4.01, so I am not sure what Visual Studio is doing there (possibly not applying the correct validation).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With