I noticed that you use bootstrap 3 by class img-responsive
, in bootstrap 3 the grid system still had some limitations, so I advise you to take a look at the new version, the grid part and content alignment are very good.
To do what you need in Bootstrap 3 you will need some custom CSS lines to complement.
You have several ways to do it the way you want it first.
That the session where text will be - image - text will be flexible if it adjusts without .col
.
The second is with the already pre-defined sizes with .col
for each item.
Check out the redrawd with Bootstrap v3 which I believe is the one you are using.
.fourth {
display: flex;
align-items: center;
}
.fourth div,
.fourth figure {
-ms-flex: 1 1 auto!important;
flex: 1 1 auto!important;
margin: 0 10px;
}
<!-- Bootstrap assets -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<div class="container fourth">
<div>
<h4>Título</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur a porta tellus. Donec lobortis, nibh non lacinia pellentesque, neque felis finibus justo, ac feugiat augue lectus ut orci. Duis ac volutpat ligula, sed cursus est.</p>
</div>
<figure>
<img src="https://d2gg9evh47fn9z.cloudfront.net/800px_COLOURBOX23310792.jpg"class="img-responsive img-circle" >
</figure>
<div>
<h4>Título</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur a porta tellus. Donec lobortis, nibh non lacinia pellentesque, neque felis finibus justo, ac feugiat augue lectus ut orci. Duis ac volutpat ligula, sed cursus est.</p>
</div>
</div>
The second way is to pre-define the sizes of each area.
.fourth > .d-flex {
display: flex;
align-items: center;
}
.fourth div,
.fourth figure {
-ms-flex: 1 1 auto!important;
flex: 1 1 auto!important;
}
<!-- Bootstrap assets -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<div class="container fourth">
<div class="row d-flex">
<div class="col-xs-12 col-sm-12 col-md-4">
<h4>Título</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur a porta tellus. Donec lobortis, nibh non lacinia pellentesque, neque felis finibus justo, ac feugiat augue lectus ut orci. Duis ac volutpat ligula, sed cursus est.</p>
</div>
<figure class="col-xs-12 col-sm-12 col-md-4">
<img src="https://d2gg9evh47fn9z.cloudfront.net/800px_COLOURBOX23310792.jpg"class="img-responsive img-circle" >
</figure>
<div class="col-xs-12 col-sm-12 col-md-4">
<h4>Título</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur a porta tellus. Donec lobortis, nibh non lacinia pellentesque, neque felis finibus justo, ac feugiat augue lectus ut orci. Duis ac volutpat ligula, sed cursus est.</p>
</div>
</div>
</div>
And one more detail, my point of view is that whatever you choose for your project is to insert in @media
that display: flex;
attributes are only displayed in resolutions above 992px
, but why? Because in the mobile the display: flex;
attribute will try to align all of them side by side by making them all stand on one line which will be bad for minor resolutions.
So it would look like CSS.
@media(min-width: 992px) {
.fourth > .d-flex {
display: flex;
align-items: center;
}
.fourth div,
.fourth figure {
-ms-flex: 1 1 auto!important;
flex: 1 1 auto!important;
}
}
I hope I have been able to help you and help the community!