HTML href attribute exclusively for a / a beacon?

3

It is correct to set the href attribute to another beacon that is not a .

Example:

<ul>
  <li href="#page1">Page1</li>
  <li href="#page2">Page2</li>
  <li href="#page3">Page3</li>
  <li href="http://www.google.fr">Page3</li>
</ul>

Apparently it worked in my case, but is this correct?

    
asked by anonymous 08.01.2017 / 15:03

2 answers

6

Is incorrect in li . You can see that it does not work in the example of the question. This attribute is specified as belonging to some tags , such as <a> , <area> , <base> and <link . So when using it elsewhere it is considered a custom attribute and will probably be disregarded.

MDN Attributes Documentation .

W3C Documentation .

    
08.01.2017 / 15:16
2

I think it's incorrect:

Second W3C :

  
    

4.4.7 The li element     Content attributes:     Global attributes

  

Content attributes: Global attributes and href , is not a global attribute.

    
08.01.2017 / 15:24