▶ 중요도
▶ 구체성 (명시도)
▶ 선언순서
background-color
background-image : url(“이미지 경로”);
background-image : linear-gradient(방향,시작 색상,종료 색상);
background-position : center; - 배경이미지의 위치를 지정함
background-repeat : no-repeat;|repeat;|repeat-x;|repeat-y;
background-size : auto;(기본값)|cover;|contain;
background-attachment : scroll;(기본값)|fixed;|local;
background : color imageUrl repeat position/size attachment;
background : red url(“이미지 경로”) no-repeat center/cover fixed;
object-fit : cover;|fill;(기본값)|contain;|none;
object-position : 100px 40px;
06-02.html
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>06-02-calc2</title>
<link rel="stylesheet" href="./index.css">
</head>
<body>
<div class="container">
<div class="sidebar">
<ul>
<li>메뉴1</li>
<li>메뉴2</li>
<li>메뉴3</li>
<li>메뉴4</li>
</ul>
</div>
<div class="contents">
<div class="item">상품</div>
<div class="item">상품</div>
<div class="item">상품</div>
<div class="item">상품</div>
<div class="item">상품</div>
<div class="item">상품</div>
<div class="item">상품</div>
<div class="item">상품</div>
</div>
</div>
</body>
</html>
06-02.css
```css
* {
box-sizing: border-box;
}
.container {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
}
.sidebar {
width: 170px;
background-color: orange;
padding: 5px 15px;
}
.sidebar ul {
width: 100%;
padding: 0;
}
.sidebar ul li {
list-style: none;
padding: 5px 0;
color: white;
border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
}
.contents {
width: calc(100% - 170px);
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
flex-wrap: wrap;
padding: 0 10px;
}
.item {
width: 24%;
height: 180px;
margin-bottom: 10px;
background-image: url("../image/dochi.jpeg");
background-size: cover;
color: white;
}
```
앞에 보여지는 우선순위 조정
z-index: auto; (기본값)
z-index: 1;
숫자가 클 수록 앞에 보여짐
transition-property: color,trasform;
transition-duration: 0.2s;
transition-duration: ease-in-out;|linear;|ease;|ease-in;|ease-out;
transition-delay: 2s;
transition: property duration timing-function delay;
transition: color 0.4s ease-in-out 1s;
출처 : 코드캠프