rhgiant — 2012-02-05T04:34:07-05:00 — #1
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?
xhtmlcoder — 2012-02-05T06:45:13-05:00 — #2
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.
paulob — 2012-02-05T08:18:30-05:00 — #3
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.
system — 2012-02-05T10:12:59-05:00 — #4
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...