Hi there! I am currently working on implementing a layout shifter pattern with Bootstrap 4.
So far, I have successfully positioned 2 colored boxes responsively, but I am facing some challenges with getting the third box in the right place.
If you have any tips or suggestions on how I can achieve this, please let me know. Below is the HTML code I am working with:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Layout Shifter</title>
<link href="bootstrap.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
</head>
<body>
<!-- navbar -->
<nav class="navbar fixed-top navbar-light bg-light">
<a class="navbar-brand" href="#">Layout Shifter</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home</a>
</li>
</ul>
</div>
</nav>
<div class="container-fluid">
<div class="row no-gutters">
<div class="col-12 col-md-2">
<div class="blue"></div>
</div>
<div class="col-12 col-md-10">
<div class="red"></div>
</div>
<div class="col-12 col-md-10">
<div class="purple"></div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ"
crossorigin="anonymous"></script>
</body>
</html>
And here is the CSS code I am using:
.blue{
width:100%;height:1100px;
background-color:rgb(88, 88, 211);
}
.red{
width:100%;height:550px;
background-color:rgb(216, 90, 90);
}
.purple{
width:100%;height:550px;
background-color:rgb(168, 68, 214);
}
.orange{
width:100%;height:550px;
background-color:rgb(212, 135, 46);
}
.light-blue{
width:100%;height:550px;
background-color:rgb(160, 168, 238);
}
.container-fluid{
padding:0;
}
.img-fluid{
width:100%;
}
.bg-light{
background-color: #384f3f !important;
}
.navbar-brand{
color: white !important;
}
.nav-link{
color: white !important;
}
.img-responsive{
max-height:550px;
width:100%;
}
.navbar-toggler{
color:white !important;
border-color:white !important;
}