I can't figure out why my H1
is not visible. It seems to be hidden by a div
. What's strange is that the parent div
is visible when I change the background
color to something other than transparent
. Even an input tag within the same div
displays correctly. Only the H1
is causing issues.
Check out the code here: H1 does not show up And here's the HTML code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div class="outerContainer">
<div class="imageSlider">
<div class="overlayShadow"></div>
<div class="content">
<h1> Test </h1>
<input>
</div>
</div>
</div>
</body>
</html>
SCSS:
.outerContainer {
z-index: 1;
overflow: hidden;
height: 80vh;
.imageSlider {
z-index: -1;
height: 80vh;
position: relative;
margin-bottom: 20px;
background-position: center;
background-size: cover;
overflow: hidden;
background-image: url('https://tinypng.com/images/social/website.jpg');
animation: mymove 7s cubic-bezier(0,1,0,.5)infinite;
transform: scale(1.5,1.5);
.overlayShadow {
z-index: -1;
width: 100%;
height: 100%;
position: absolute;
background-color: #000;
animation: darken 7s cubic-bezier(0,1,1,.8) infinite;
}
}
}
@-webkit-keyframes mymove {
0% {
top: 0px;
}
100% {
top: -70px;
}
}
@keyframes mymove {
0% {
top: 0px;
}
100% {
top: -70px;
}
}
@-webkit-keyframes darken {
0% {
opacity: 1;
}
26% {
opacity: 0;
}
90% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes darken {
0% {
opacity: 1;
}
10% {
opacity: 0;
}
90% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.content {
z-index: 1 !important;
position: absolute !important;
height: 300px !important;
top: 50% !important;
width: 100% !important;
margin: 0 auto !important;
h1 {
font-size: 24px !important;
display: inline-block !important;
z-index: 999 !important;
font-size: 14px !important;
line-height: 1.43 !important;
color: #484848 !important;
}
}
Does anyone have any insights into why this is happening? Your help would be greatly appreciated.