CSS
[CSS] 이미지 수직 수평 정렬
힘없는염소
2018. 9. 11. 10:43
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<style type="text/css">
.wrap {
width: 360px;
height: 240px;
margin: 50px auto;
text-align: center;
border: 1px solid #000;
}
.wrap * {
display: inline-block;
height: 100%;
vertical-align: middle;
}
.wrap img {
width: auto;
height: 120px;
}
</style>
</head>
<body>
<div class='wrap'>
<span></span>
<img src="img/beetle.jpg" />
</div>
</body>
</html>
반응형