<!doctype html> <style> .container { position: relative; } a { position: absolute; inset: 0; background-color: rgba(0, 0, 0, .2); } </style> <div class="container"> <a href="#"></a> Some text that you should be able to read. </div>