<!DOCTYPE html> <style> .rel { position: relative; } .abs { width: 100%; position: absolute; padding-top: 50%; } </style> <div class="rel"> <div class="abs"></div> </div>