반응형
1. HTML Code
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>CSS 2일차</title>
<link href="css/ex05.css" rel="stylesheet">
</head>
<body>
<h1>위치 속성</h1>
<div id="mama">
<div id="box1">박스1</div>
<div id="box2">박스2</div>
<div id="box3">박스3</div>
</div>
</body>
</html>
2. CSS Code
@charset "utf-8";
/* CSS Document */
*{
margin:0;
padding:0;
}
ul, li{
list-style:none;
}
h1{
width:100%;
background:pink;
width:70%;
margin:auto;
text-align:center;
height:80px;
line-height:80px;
/* line-height:calc(80px); */
}
div{
width:150px;
height:150px;
border:3px solid black;
}
#box1{
background:red;
position:absolute;
left:50px;
top:50px;
z-index:2;
}
#box2{
background:blue;
position:absolute;
left:150px;
top:150px;
z-index:1;
}
#box3{
background:pink;
position:absolute;
right:10px;
bottom:150px;
}
div#mama{
width:500px;
height:250px;
border:3px soild red;
position:relative;
overflow:hidden;
}
h2{
position:fixed;
background:black;
color:white;
width:100%;
top:0;
left:0;
}
div#mama:hover{
overflow:scroll;
}
ul{
overflow:hidden;
position:relative;
left:200px;
top:100px;
}
ul li{
float:left;
}
3. HTML / CSS 파일
4. HTML 미리보기
반응형
'Python_WEB > HTML' 카테고리의 다른 글
HTML5 - 190609 Basic Study 29(Sitemap 제작 - 1) (0) | 2019.06.09 |
---|---|
HTML5 - 190609 Basic Study 28(positon과 float를 이용한 레이아웃 설계) (0) | 2019.06.09 |
HTML5 - 190609 Basic Study 26(:taget 활용하기) (0) | 2019.06.09 |
HTML5 - 190609 Basic Study 25(상태,링크,반응 선택) (0) | 2019.06.09 |
HTML5 - 190609 Basic Study 24(CSS 속성 선택자) (0) | 2019.06.09 |