div height 100% 관련입니다.

국내에 웹 사이트들이 웹 표준을 지키고 OS나 브라우저와 관계 없이 접근성을 향상 시키기 위한 사이트 버그 신고 및 문제 해결을 위한 게시판입니다.
댓글 게시
rainywalker

div height 100% 관련입니다.

게시물 작성자 rainywalker » 2009 09 24 13:49 27

코드: 모두 선택

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="Application/xhtml+xml; charset=utf-8" />
<meta name="title" content="" />
<meta name="author" content="" />
<meta name="subject" content="" />
<meta name="keywords" content="" />
<title>포항시 버스정보시스템</title>
<link href="../common/css/searchPop.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../common/js/script.js" ></script>
<style type="text/css">
#popWrap {min-height:100%;padding:0 12px;background:url(../../busSearch/img/popWrapBg.gif) repeat-x;border:1px solid red }
#popWrap:after {display:block; clear:both; content:" "; visibility:hidden; height:0}
* html #popWrap {height: 100%;}

#test {height:100%; border:1px solid blue;}
</style>
</head>
<body>

<div id="popWrap">


	<div id="test">
	test
	</div>
</div>
</body>
</html>
소스에서 보듯이 부모엘레멘트인 popWrap에선 height값이 100%적용이 되고 잇는데
그 밑에 자식엘레멘트 test 또한 100%든 50%든 %로 높이값을 주어서 브라우저 크게 상관없이
상대적으로 높이가 늘어나게 할려면 어찌해야 할까요..ㅠㅠ

플래시처럼 브라우저에 상관없이 보여지게 할라고 하거든요..
어제부터 고생고생을 하고 있는데 답을 찾을수가 없습니다 ㅠㅠ

송효진
게시물: 33
참여됨: 2007 04 26 17:20 09
연락:

Re: div height 100% 관련입니다.

게시물 작성자 송효진 » 2009 10 09 17:44 18

직계부모에 height 가 있으면 %가 적용됩니다.

즉, html, body 에 height 100% 를 주면 직계자손 div 에 height 100% 가 가능해지고,
또 다시 그 직계 div 에 %를 적용할 수 있습니다.

댓글 게시

누군가 접속

유저들이 이 포럼을 탐색중: 가입된 유저 없음 그리고 15 손님들