Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS vertical align two class with youtube Reply To: vertical align two class with youtube

#197242
Paulie_D
Member

I think the answer lies in the padding-bottom

To maintain a ratio of a 100% wide div we need to set the padding-bottom as 56.25% (9/16)….

But our parent div isn’t 100% wide…it’s 40% wide so we need to calculate that number again

This 56.25 / (4 * 10) give us 22.5 but we don’t actually need to do that ourselves because we can use calc.

http://codepen.io/Paulie-D/pen/wBxPWe