Skip to content

Fill a Div with a Link Tag

You can fill a whole div or other parent element in HTML with a link tag using some property permissions 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 paret 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.

Leave a Comment

Scroll To Top