You need a container in which block elements will be placed, to make a link. The link is a string element, you can assign display: block; but what will happen with the validity of html. Which solution is the right one?

  • 2
    hmtl5 it admits. Declare the document correctly and the w3c validator will understand everything correctly. - Andrey Fedorov

1 answer 1

To make a document valid, use span instead of div to fill in the link, and assign it a dispay: block. In this case, the html will be valid, as the default span is lowercase.

a { display:block; } span { display:block; } 
 <a href="#"> <span>text</span> </a>