Categories
Front-End

Should you wrap block elements with anchor tags?

A question that pops every now and then — should you wrap block elements with anchor: <div> with anchor tag <a> ? This is one of the many decisions front-end developers have to make on a daily basis.

TLDR: Yes, you can. Don’t sweat over it.

First – what is the difference between a block and an inline element like <a>?

By default, a block-level element occupies the entire space of its parent element (container), thereby creating a “block.” 

Block-Level Elements, MDN