내 블로그 목록

2018년 6월 27일 수요일

[HTML] Float/Overflow 실습


<!DOCTYPE html>
<html>
   <head>
       <title>Position 속성</title>
       <style>
           .box{
               width:100px;
               height:100px;
               border: 1px solid #000000;
               float: left;
           }
           
           #apple{
               background-color: hotpink;
               top: 50px; /*absolute에서 50px 떨어지게*/
               left: 50px;
               z-index:10000000;
           }
           
           #banana{
               background-color: greenyellow;
               top: 100px;
               left: 100px;
               z-index:100;
           }
           
           #car{
               background-color:blue;
               top:150px;
               left: 150px;
               z-index:1;
           }
           
           
           #container{
               overflow: hidden;
           }
                
       </style>
   </head>
   <body>
       <h1>헤더 로고와 메뉴가 있는 영역입니다.</h1>
         <div id="container">
           <div id="apple" class="box"></div>
           <div id="banana" class="box"></div>
           <div id="car" class="box"></div>
         </div>
       <h1>푸터 회사정보가 있는 영역입니다.</h1>
   </body>
</html>

댓글 없음:

댓글 쓰기