html5: <a> no longer on steroids?

Hello,

I thought it was ok to have the <a> element wrap, say, <li> element. It validated in december. Now it doesn’t anymore.

Has something changed?

:slight_smile:

It’s never validated in a normative markup language for LI and I cannot ever remember it being allowed in Fred either since UL contains zero or more LI elements anyway.

However, if you are meaning the Anchor would be allowed around certain elements like P element; it may be wrapped around entire paragraphs within Fred, yes. Though obviously it depends on content type and contents, and LI obviously is an example of where you cannot wrap it around and never have been able to do.

Note that although html5 allows anachors around certain elements as Robert mentions above most browsers still hate it and I’m seeing more and more bugs in the CSS forum where layouts are breaking because of this. I would recommend that you don’t do it as in most cases there isn’t really a need. If you do use it the at least set it to display:block to avoid some (not all) of the bugs.

At which point take the next step and pretend the HTML 5 idiocy (at least so far as the actual HTML part is concerned) doesn’t even exist… It’s really for the better to stick with the current RECOMMENDATION, especially since it lacks all the bloat and nonsensical elements people are abusing for nothing as if it was the bleeding edge of 1998.

HTML 5 – setting coding practices back a decade or more…