외부 div 요소를 만들었고 그 안에 간단한 사각형을 만들려고합니다. 이제, 첫 번째면의 수평 위치가 나타납니다. 그러나 세로 배치의 경우 lenght1 div 위쪽과 아래쪽 div 사이에 10px의 여백을두고 싶습니다. 다음은 제 코드입니다.이 사각형의 위쪽과 아래쪽에 여백을 남기려면 어떻게해야합니까?
<!DOCTYPE html>
<html>
<head>
<style>
*{
margin:0px;
padding:0px;
}
body{
margin:10px 0px;
}
div.outer{
height:400px;
width: 500px;
margin:100px auto;
margin-top: 130px;
background-color:red;
}
div.length1{
height:380px;
width:30px;
margin:10px 470px 10px 0px;
background-color:blue;
}
</style>
</head>
<body>
<div class="outer">
<div class="length1"></div>
<div class="breadth1"></div>
<div class="length2"></div>
<div class="breadth2"></div>
</div>
</body>
</html>
가능한 중복 collapsing?] (http://stackoverflow.com/questions/19718634/how-to-disable-margin-collapsing) – LGSon