I managed to do with transform: translateY
. I created the . vertical class, and put in the <div>
that you want to align vertically.
.vertical {
transform: translateY(50%);
}
Run the Snipper on "Whole Page" to see it working right. Because it is with the Bootstrap classes according to the code you posted...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" media="screen" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" />
<link rel="stylesheet" type="text/css" media="screen" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
<style>
@media screen and (min-width: 768px) {
.vertical{
transform: translateY(50%);
}
}
</style>
</head>
<body>
<div class="row">
<div class="col-md-3 col-ms-3 col-xs-3">
<img src="http://placecage.com/50/150" style="height: 100%; width: 100%;">
</div>
<div class="col-md-3 col-ms-3 col-xs-3">
<img src="http://placecage.com/50/150" style="height: 100%; width: 100%;">
</div>
<div class="col-md-3 col-ms-3 col-xs-3">
<img src="http://placecage.com/50/150" style="height: 100%; width: 100%;">
</div>
<div class="col-md-3 col-ms-3 col-xs-3 vertical">
<img src="http://placecage.com/50/150" style="height: 100%; width: 100%;">
</div>
</div>
<div class="row">
<div class="col-md-3 col-ms-3 col-xs-3">
<img src="http://placecage.com/50/150" style="height: 100%; width: 100%;">
</div>
<div class="col-md-3 col-ms-3 col-xs-3">
<img src="http://placecage.com/50/150" style="height: 100%; width: 100%;">
</div>
<div class="col-md-3 col-ms-3 col-xs-3">
<img src="http://placecage.com/50/150" style="height: 100%; width: 100%;">
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>
NOTE: To make no mistake on different screens you can put in the sizes div for each screen (col-Md-3 col-ms-3 col-Xs-3), kind of:
<div class="col-md-3 col-ms-3 col-xs-3 vertical">
<img src="http://placecage.com/50/150" style="height: 100%; width: 100%;">
</div>
is that standard? or may vary?
– novic
Standard, in case only will vary for mobile on Sm screens
– Everton Figueiredo
why don’t you put it in a
row
with 12 columns and center alignment would not solve?– novic