ずっと知らなかったんですが、結構有名みたいです。
#mov_block { position: relative; width: 100%; padding-top: 56.25%//calc(100% / 16 * 9); } #mov_block iframe { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
calcがオブジェクト自身の位置やサイズなどを取得できればいいのに……できるのかな?
日々のひとりごと
ずっと知らなかったんですが、結構有名みたいです。
#mov_block { position: relative; width: 100%; padding-top: 56.25%//calc(100% / 16 * 9); } #mov_block iframe { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
calcがオブジェクト自身の位置やサイズなどを取得できればいいのに……できるのかな?