This exercise nests anchors within `<li>` elements. Wouldn’t it make more sense to make the entire `<li>` a clickable anchor by nesting the `<li>` in anchor tags instead?


#1

Question

This exercise nests anchors within <li> elements. Wouldn’t it make more sense to make the entire <li> a clickable anchor by nesting the <li> in anchor tags instead?

Answer

This does make sense. However, this would be invalid syntax and should be avoided. As specified in mozilla docs, <li> elements should always be direct children of either <ol>, <ul> or the experimental <menu> tags.


FAQ: Learn HTML Elements - Common HTML Elements - Linking to Same Page