안녕하세요 선생님
강의 잘 듣고 있습니다
리액트 부터 설명이 직관적이라 듣게 됬는데, 노드, CSS...
계속해서 다른 강의도 수강하게 되네요 ㅋㅋㅋㅋ
다름이 아니라 HTM/CSS강의 position 숙제 & 반응형 width & box-sizing 영상을 보고
z-index를 따라 적용 하려는데 생각대로 작동이 되지 않아서요 ;;;
.main-button에는 z-index를 100
.main-button에는 z-index를 1
로 설정하여 버튼이 화면에 보이게 하려고 했는데 적용이 되지 않습니다
"z-index가 높은 요소가 왜 view에서 보이지 않는지 궁금합니다"
// layout2.html
<!DOCTYPE html>
<html lang="en">
<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" />
<link href="./layout2.css" rel="stylesheet" />
<title>Document</title>
</head>
<body>
<div class="main-background">
<h4 class="main-title">Buy ones</h4>
<button class="main-button">Buy Now</button>
</div>
<div class="new-box"></div>
</body>
</html>
// layout2.css
.main-background {
width: 100%;
height: 500px;
background-image: url(shoes.jpeg);
background-size: cover;
filter: brightness(70%);
padding: 1px;
text-align: center;
position: relative;
}
.main-title {
color: white;
font-size: 40px;
margin-top: 200px;
}
.main-button {
padding: 15px;
font-size: 20px;
background: white;
border: none;
position: relative;
left: 0;
right: 0;
margin: auto;
width: 150px;
z-index: 100;
}
.new-box {
background-color: red;
width: 700px;
height: 100px;
padding: 20px;
margin-left: auto;
margin-right: auto;
position: relative;
top: -200px;
z-index: 1;
}