I am trying to create vertical align middle between two div using table cell method. I want to make single-slider div vertical align middle. But I am failed. Can anybody please help me? I have some confused about that.Here is my code:
.slider-area {
height: 100%;
width: 100%;
}
.silder-inner {
height: 100%;
display: table;
}
.single-silder {
height: auto;
display: table-cell;
vertical-align: middle;
}
<div class="slider-area">
<div class="silder-inner">
<div class="single-slider">
<div class="container">
<div class="row">
<div class="col-md-12">
<h3>Holla You'r Welcome</h3>
<h2>Best <span>Digital Agency</span> &<br>Business Farm</h2>
<a href="" class="btn custom-btn slider-btn">Contract Now</a>
</div>
</div>
</div>
</div>
</div>
</div>
2
Answers
first of all you give wrong class in your html & css. it’s
single-slider
in html and.single-silder
in css. and you also need to setheight
for body and html.Doing it the Flex Way: