I'm trying to center (horizontally and vertically) a div inside a column (it's the one with class="centered-column"
) nested under a flex row.
I tried to apply the inforamtion given on this answer, and also on this css-tricks guide, without success.
Here's the code:
span {
font-size: 20px;
}
.row {
display: -webkit-flex;
display: -ms-flexbox;
}
.col-md-8 {
background-color: lightblue;
}
.centered-column {
display: flex;
flex-direction: column;
justify-content: center;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<div class="container">
<div class="row">
<div class="col-md-4 text-center">
<div class="row">
<div class="col-md-12">
<span>Row number 1</span>
</div>
</div>
<div class="row">
<div class="col-md-12">
<span>Row number 2</span>
</div>
</div>
</div>
<div class="col-md-8">
<div class="centered-column">
<span>Some text<span>
</div>
</div>
</div>
What should I do to make it work (Note that I have to use Bootstrap 3)?