DEV Community

Discussion on: CSS can help improve your HTML⁉ - Ep 2: buttons and links.

Collapse
 
ashleyjsheridan profile image
Ashley Sheridan

My point about the <a> without an href attribute wasn't about anchors, but still links. Imagine something like this:

<a>You can find your purchased download here.</a>
Enter fullscreen mode Exit fullscreen mode

This would create the link as a placeholder, which might be useful for visual reasons, but it wouldn't yet be an active control. Then, based on some sort of event, you could make it active by giving it a valid href value using Javascript.

It's not a common pattern, but it's a completely one.

Thread Thread
 
grahamthedev profile image
GrahamTheDev

I used "anchors" for all <a> elements, perhaps the wording wasn't clear but I was talking about <a name="" would then be a warning in addition to allowing for <a>some text</a> to be a warning rather than an error (just in case you did want to do something like you suggest).

I think we are in agreement! lol!