Mobile app version of vmapp.org
Login or Join
Shelton105

: Is link a broken link? When using empty URL fragment links, to send a user to the top of the page (e.g. <a href="#">return to top</a>), are these links considered broken or invalid?

@Shelton105

Posted in: #Html #Links #Validation

When using empty URL fragment links, to send a user to the top of the page (e.g. <a href="#">return to top</a>), are these links considered broken or invalid? One of my tools is returning them all as broken links.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Shelton105

2 Comments

Sorted by latest first Latest Oldest Best

 

@Welton855

Technically, "#" is a well-defined URL reference that points to the start of the current document, so it is not “broken” in formal sense. It can, however, be regarded as bad for accessibility, and it is also a common symptom of “fake” links, i.e. a elements that are supposed to link to something external but depend on JavaScript. (In the very old days, <a href="..." onclick="..."> was the only kind of element that supported the onclick attribute, so people wrote the “dummy” href="#" attribute, which isn’t really dummy.)

So you can regard this as an incorrect error message, or as a useful warning message that might be a little poorly formulated.

10% popularity Vote Up Vote Down


 

@BetL925

I don't think it is considered as broken link.

Broken link is a link that points to resources doesn't exist (404 HTTP response).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme