Fill a whole Div element with a Link Tag inside the Div

You can fill a whole div or other parent element container in HTML with a link tag inside the div using some positioning attributes in CSS.

<div style="position: relative; ">

<a href="#" class="link-tag" style="position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;"></a>


The link tag is absolutely positioned to its parent which is relatively positioned, and will now fill the whole parent tag. You can either wrap the link tag around the inner HTML elements or let it sit on its own – if the latter is applied then a z-index property may need to be applied to trump other HTML elements.