I am attempting to center my div container .home-img-text
vertically in the middle of its parent div .home-img
. Despite trying various methods such as setting .home-img-text
to position: absolute
, relative
, adding padding-top
, and several others, I haven't been successful in moving it from the top of its parent div.
If you would like to see the issue for yourself, you can visit the following site:
click here
I haven't included a code snippet because the image doesn't display properly with my parallax effect.
Could someone identify what might be causing this problem?
CSS:
.home-img {
position: relative;
margin: auto;
width: 100%;
height: auto;
vertical-align: middle;
}
.parallax-window {
min-height: 300px;
background: transparent;
position: relative;
}
.home-img-text {
position: relative;
z-index: 99;
color: #FFF;
font-size: 4em;
text-align: center;
top: 40%;
}
HTML:
<div class="home-img">
<div class="parallax-window" data-parallax="scroll" data-image-src="/images/try.jpg">
<div class="home-img-text">Quality Solutions</div>
</div>