z-index

양은지·2023년 3월 28일
0

HTML/CSS

목록 보기
9/29

z-index

.back {
	position: absolute;
    top: 0;
    left: 0;
    width: 400px;
    height: 200px;
    z-index: 1;
}

.front {
	position: absolute;
    top: 0;
    left: 0;
	width: 200px;
    height: 100px;
    z-index: 5;
}
  • floating 되어 있는 개체들의 레이어 순서를 부여해주기 위해 z-index를 사용할 수 있다
  • z-index는 클수록 상위 노출이고, 임의의 정수를 사용하면 된다
profile
eunji yang

0개의 댓글