css position Overlapping Elements(겹치는 요소들) 정보
CSS css position Overlapping Elements(겹치는 요소들)본문
Overlapping Elements(겹치는 요소들)
요소가 배치되면 다른 요소와 겹칠 수 있습니다.
이 z-index속성은 요소의 스택 순서를 지정합니다.이 요소는 다른 요소의 앞에 또는 뒤에 있어야합니다.
요소는 양수 또는 음수 스택 순서를 가질 수 있습니다.
img {
position: absolute;
left: 0px;
top: 0px;
z-index: -1;
}
<!DOCTYPE html>
<html>
<head>
<style>
img {
position: absolute;
left: 0px;
top: 0px;
z-index: -1;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<img src="w3css.gif" width="100" height="140">
<p>Because the image has a z-index of -1, it will be placed behind the text.</p>
</body>
</html>
추천
0
0
댓글 0개