<!DOCTYPE html>
<html lang="ko">
<head>
<title>09_absoulte</title>
<!-- 현재페이지에서 css 초기화 -->
<link rel="stylesheet" href="../css/reset.css">
<style>
/* #s1 ul{background-color: yellow; height: 300px;
}
s1의 li목록에서 첫번째 항목
#s1 li:nth-child(1){
background-color: red;
position: absolute;
left: 100px;
top: 30px;
}
absoulte 원래 있던 영역을 버리고 이동
#s1 li:nth-child(2){
background-color: red;
position: absolute;
right: 0;
bottom: 0;
} */
/* 아무것도 명시하지 않는 경우 body 기준
#s1 li:nth-child(1){
background-color: red;
position: absolute;
left: 0;
top: 0;
}
#s1 li:nth-child(2){
background-color: darkgreen;
}
#s1 li:nth-child(3){
background-color: aqua;
} */
/* 2. 부모 영역을 기준으로 position: relative */
/* 부모 ul 자식 li */
/* #s1 ul{
background-color: yellow;
position: relative;
height: 300px;
}
#s1 li:nth-child(1){
background-color: rebeccapurple;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
}
#s1 li:nth-child(2){
background-color: darkgreen;
}
#s1 li:nth-child(3){
background-color: aqua;
} */
#s1 ul{
background-color: yellow;
width: 300px;
height: 300px;
position: relative;
}
#s1 li:nth-child(1){
background-color: rebeccapurple;
position: absolute;
width: 100%;
right: 0;
bottom: 0;
}
#s1 li:nth-child(2){
background-color: darkgreen;
}
#s1 li:nth-child(3){
background-color: aqua;
}
</style>
</head>
<body>
<!-- 절대적 위치 position:absoulte -->
<section id="s1">
<h3>
position:absolute
</h3>
<ul>
<li>국어</li>
<li>영어</li>
<li>수학</li>
</ul>
</section>
</body>
</html>