Update in Sep, 2023: latest HTML5 version
- Nothing is wrong with placing a
div
insidea
tag. In fact, you can place just about anything insidea
tag as long as they are categorized astransparent
, except that no descendant may beinteractive content
(eg: buttons or inputs) or ana
element, and no descendant may have a specifiedtabindex
attribute.Please refer to these documentations: - If you inspect Angular Material official website, one of the leading UI component libraries, you can tell that they are indeed using
div
insidea
element.
This is an example I took from their website:
<a href="/components/badge"><div class="mat-list-item-content"><div mat-ripple="" class="mat-ripple mat-list-item-ripple"></div><div class="mat-list-text"></div></div></a>