프로그램/html,css2014. 4. 19. 16:43

<html>
<head>
<style>
.middle_area {clear:both;position:relative;height:100%;}
.loading {position: absolute;top:50%;left:50%;}
</style>
</head>
<body>
 <div>상단 영역</div>
 <div class="middle_area">
  <div class="loading">세로 및 가운데 정중앙 정렬</div>
  <div>
   본문 영역<br />
   <a href="okkks.tistory.com" target="_blank">okkks.tistory.com</a><br />
   <a href="okkks.tistory.com" target="_blank">okkks.tistory.com</a><br />
   <a href="okkks.tistory.com" target="_blank">okkks.tistory.com</a><br />
   <a href="okkks.tistory.com" target="_blank">okkks.tistory.com</a><br />
   <a href="okkks.tistory.com" target="_blank">okkks.tistory.com</a><br />
   <a href="okkks.tistory.com" target="_blank">okkks.tistory.com</a><br />
   <a href="okkks.tistory.com" target="_blank">okkks.tistory.com</a><br />
   <a href="okkks.tistory.com" target="_blank">okkks.tistory.com</a><br />
   <a href="okkks.tistory.com" target="_blank">okkks.tistory.com</a>
  </div>
 </div>
 <div>하단 영역</div>
</body>
</html>

 

<div class="loading">세로 가운데 정중앙 정렬</div>를 본문 영역 기준으로 정중앙 정렬한 후 띄운다.

 

.middle_area {clear:both;position:relative;}

height:100%;부분을 삭제했을 경우


 

 

더보기>

- css div 글자 가로, 세로 가운데(중앙)정렬

Posted by 은둔고수