Reputation: 952
I want to two images diagonally one below another like this, and they should remain like that responsively.
So far I've got this, but the images are moving when I re-size the window and it is not responsive. Is it possible to make it responsive using bootstrap?
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<div class="row">
<div class="col-md-8">
<img class="img-responsive" align="left" src="img1.png" />
</div>
</div>
<div class="row">
<div class="col-md-8">
<img class="img-responsive" align="left" src="img2.png" />
</div>
</div>
Upvotes: 1
Views: 604
Reputation: 4400
Use col-*-offset-*
instead of aligning left/right. Check below snippet for reference.
.p0 {
padding: 0 !important;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-6 p0">
<img class="img-responsive" src="http://via.placeholder.com/600x400/green" />
</div>
</div>
<div class="row">
<div class="col-xs-6 col-xs-offset-6 p0">
<img class="img-responsive" src="http://via.placeholder.com/600x400" />
</div>
</div>
</div>
</body>
</html>
Upvotes: 1