I am able to use 2 full viewport div using the following code. Sadly, when I try to add an HD (1366x768) image as the background for the first full viewport div, it breaks everything. I tried to use img-fluid as mentioned in Bootstrap 5 docs
I am using the default HTML template provided by getbootstrap.com as starting template.
It would be nice to know how to make the background image responsive and still keep the 2 full viewport sections intact. Please feel free to ask any other info you would want to know. Thanks.
<div class="container-fluid px-0 overflow-hidden">
<div class="w-100 vh-100 bg1">
<!-- need to add a responsive background using an SVG file with HD size here -->
<img src="bg.svg" class="img-fluid" alt="bg"> <!-- breaks everything -->
</div>
<!-- 2-->
<div class="w-100 vh-100 bg2">
<div class="row bg3 text-center">
<div class="col pd50">
<div class="row row-cols-2">
<div class="col pd20 and"><i class="fab fa-android fa-5x green"></i><p>Android apps</p></div>
<div class="col pd20 ang"><i class="fab fa-angular fa-5x red"></i><p>Single Page Apps</p></div>
<div class="col pd20 chr"><i class="fab fa-chrome fa-5x blue"></i><p>Web Apps</p></div>
<div class="col pd20 dok"><i class="fab fa-docker fa-5x bluesky"></i><p>Cloud based apps</p></div>
</div>
</div>
<div class="col pd50">
<i class="fab fa-chromecast fa-10x blue"></i><hr>One website, which works on Android, iPhone, iPad, Tablets, Laptops, Desktop and all. Fast, responsive, modern and secure framework.
</div>
<div class="align-item-center text-center pdbot50">
<a href="mailto:jeeve@gmail.com"><button type="button" class="btn btn-outline-danger">@gmail</button></a>
</div>
</div>
</div>
</div>
CSS in case you need to refer
/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:wght@300&display=swap');
body {
font-family: 'Work Sans', sans-serif;
}
.fullbg {
background-image: url(/home.svg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.landpg {
background-image: url(/home.svg) fixed;
}
#grad {
background-image: linear-gradient(to bottom right, #0ca8cc,#9700ff);
}
.bg1 {
background-color: #007cff;
color: white;
}
.bg2 {
background-color: #00ff64;
color: black;
}
.bg3 {
background-color: white;
}
.pd10 {
padding: 10px;
}
.pd20 {
padding: 20px;
}
.pd50 {
padding: 50px;
}
.pt50 {
padding-top: 50px;
}
.pdbot50 {
padding-bottom: 50px;
}
.marleft10 {
margin-left: 10px;
}
.green {
color: #1fec1f;
}
.blue {
color: blue;
}
.red {
color: red;
}
.bluesky {
color: skyblue;
}
.white {
color: white;
}
/* hover */
.and:hover {
background-color: rgba(37, 147, 161, 0.212);
}
.ang:hover {
background-color: rgba(37, 147, 161, 0.212);
}
.chr:hover {
background-color: rgba(37, 147, 161, 0.212);
}
.dok:hover {
background-color: rgba(37, 147, 161, 0.212);
}
screen cast. When I add the responsive image code form Bootstrap docs everything breaks as seen in GIF below
