[RESOLVED] Empty anchor element
Is the empty anchor valid HTML element?
<a href="/" id="home-link" title="Home"></a>
Originally code was
<a href="/" id="home-link">Home</a>
but I modified it, since dont want display 'Home' text.
Yes, it is valid HTML. Any element that can contain text doesn't necessarily need text.
Edit: You should note that not all browsers can find them, however. An excerpt from the HTML4 recommendation (scroll up a little bit in the document to see it in green text):
Note. User agents should be able to find anchors created by empty A elements, but some fail to do so. For example, some user agents may not find the "empty-anchor" in the following HTML fragment:
<A href="#empty-anchor">Link to empty anchor</A>
Last edited by rpgfan3233; 11-24-2008 at 07:30 AM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)