11페이지

감싸고 있는 Div height가 없습니다.

게시됨: 2007 11 21 19:23 20
작성자 ppark
<DOCTYPE>
<html>
<head>
<meta>
<title>Test Page</title>
<style>
body, td, input, textarea, select, div
{
font-family :'Malgun Gothic';
margin: 0;
padding: 0;
color : #222;
}
#favmain
{
width: 504px;
margin: 0 auto;
border: 3px solid #000;
}
#top1, #top2, #top3
{
height: 200px;
width: 500px;
position: absolute;
}
#top1
{
top: 20px;
border: 2px solid #000;
}

#top2
{
top: 200px;
border: 2px solid #00f;
}

#top3
{
top: 60px;
border: 2px solid #0f0;
}
</style>
</head>
<body>
<div><div>
</div><div>
</div><div>
</div>
</div>
</body>
</html>

위의 코드에서 top1, 2, 3은 position absolute로 두면 favmain div의 height가 0이 됩니다. 어느 부분을 해결 해야 할지 모르겠습니다. 좀 도와 주십시오.

게시됨: 2007 11 28 10:16 32
작성자 겨미겨미
position: absolute된 element는 부모 element의 크기에 영향을 주지 못합니다.
부모 element의 height를 지정해주시거나 제일 긴 (아랫쪽의) element는 다른 방식으로 넣어주셔야 할 것 같습니다.