height를 width와 똑같은 비율로 만들기
부모의 padding-bottom 값을 원하는 비율로 설정하고
자식에게 absolute를 주면 된다.
1
2
3
4
5
6
7
8
9
10
11
12
13
.wrapper {
position: relative;
width: 100%;
padding-bottom: 100%;
}
.player {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
This post is licensed under CC BY 4.0 by the author.