I have different sections on a page. I then have an image fixed under these sections. I then have a large margin on my last section so when the user is scrolling down they will see the image and it will give it a 3d sort of effect. My issue is that my #vanishing-text-container div is not showing up over the image. I am unsure why as I have added a z-index of 1, which is higher than the image.
Does anyone see why my #vanishing-text-container div is not showing over the image?
#safety-boxes, #scrolling-content, #safety-content {
width: 100%;
}
/*---Safety Boxes----*/
#safety-boxes {
/*height: 400px;*/
height: 50%;
position: relative;
z-index: 2;
}
#safety-box-large, .safety-box-small {
vertical-align: top;
}
#safety-box-large {
width: 50%;
height: 100%;
display: inline-block;
background: #FF2F2F;
}
.safety-box-small {
width: 25%;
height: 100%;
display: inline-block;
}
#safety-box2 {
background: #3e745b;
}
#safety-box3 {
background: #6f9697;
}
.safety-box-icon {
height: 150px;
width: 150px;
display: block;
margin: 0 auto;
padding: 80px 0 60px 0;
}
.safety-box-title {
color: #FFF;
font-size: 2.5em;
font-family: 'open_sanslight', "Droid Sans", sans-serif;
text-align: center;
line-height: 1.4em;
padding: 5px 8px;
}
/*----Vanishing Text ---*/
#vanishing-text-container {
width: 100%;
height: 50%;
background: #FFF;
z-index: 1;
}
#vanishing-text {
position: relative;
padding-top: 150px;
font-size: 3em;
line-height: 1.4em;
text-align: center;
}
/*---Scrolling Section---*/
#scrolling-content {
position: fixed;
top: 0;
left: 0;
/* background: green;*/
height: 400px;
}
#scrolling-content-container {
padding-top: 150px;
width: 100%;
}
#safety-main-img {
width: 100%;
height: auto;
}
#scrolling-content-description {
text-align: center;
/*position: absolute;
top: 80%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);*/
font-size: 3em;
line-height: 1.4em;
color: #FFF;
}
/*---Safety Content ---*/
#safety-content {
margin-top: 300px;
background: #EDEDED;
height: 500px;
position: relative;
z-index: 2;
}
#safety-content-container {
padding: 100px 15%;
}
#safety-content-description {
font-size: 1.5em
line-height: 1.4em;
}
<div id="safety-boxes">
<div id="safety-box-large">
<img src="images/safety/head-protection.png" class="safety-box-icon" alt="Demolition and Wrecking Safety">
<div class="safety-box-title">Safety is a top priority</div>
</div><div class="safety-box-small" id="safety-box2">
<img src="images/safety/shield.png" class="safety-box-icon" alt="The Eslich Wrecking Company Safety">
<div class="safety-box-title">Safety Training</div>
</div><div class="safety-box-small" id="safety-box3">
<img src="images/safety/wrench.png" class="safety-box-icon" alt="Demolition and Wrecking Company Safety">
<div class="safety-box-title">Right tools for the job</div>
</div>
</div>
<div id="vanishing-text-container">
<div id="vanishing-text">THE COMPANY PUTS SAFETY FIRST</div>
</div>
<div id="scrolling-content">
<div id="scrolling-content-container">
<!-- <div id="scrolling-content-description">WE CARE ABOUT THE SAFETY AND WELL BEING OF ALL LIVES</div> -->
<img src="http://optimumwebdesigns.com/eslich/images/safety/safety-main.jpg" alt="The Eslich Wrecking Company Promotes Safety Demolition" id="safety-main-img">
</div>
</div>
<div id="safety-content">
<div id="safety-content-container">
<div id="safety-content-description">Safety</div>
</div>
</div>
Aucun commentaire:
Enregistrer un commentaire