반응형으로 만들다보면 이미지가 가로로 쭈글어드는 경우가 있다. 일정 비율로 고정하는 방법
복잡하면 플러그인쓰는게 나을수도..
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>예제</title>
<style>
.box {
position: relative;
width: 50%; /* 원하는 너비 */
}
.box:before {
content: "";
display: block;
padding-top: 100%; /* 1:1 비율 */
}
.content {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background:blue;
}
</style>
</head>
<body>
<div class="box">
<div class="content">1:1 비율</div>
</div>
</body>
</html>