I am encountering two challenges:
When scaling the window down horizontally, I am facing an issue with aligning the images on the left (sideImage) vertically with the text box. I have attempted using margin-top auto and margin-bottom auto, but that does not seem to be effective.
Another problem arises when I scale down the window vertically - the top div disappears inexplicably.
Please note that I am utilizing Bootstrap for this project.
/*-- CSS --*/
* {
background-color: rgba(0, 0, 0, 0.1);
}
html,
body {
height: 100%;
}
body {
display: flex;
align-items: center;
}
.page2Box {
float: left;
display: inline-block;
clear: both;
}
.sideImage {
margin-top: auto !important;
margin-bottom: auto !important;
}
.mainImage {
float: right;
margin-top: auto !important;
margin-bottom: auto !important;
}
p {
height: 180px !important;
overflow: hidden;
}
<!DOCTYPE html>
<html>
<head>
<title>Page2_Bootstrap</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid bigBox col-md-8">
<div class="container page2Box col-md-12" id="box1">
<h2 class="col-md-5">Main Goal</h2>
<p class="col-md-8">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris ultrices urna in dui laoreet rhoncus. Vestibulum posuere mollis velit. Morbi elementum placerat erat.</p>
</div>
<div class="container page2Box col-md-4" <div class="container page2Box col-md-12" id="box2">
<img class="image-responsive sideImage col-md-4" src="placeholder.png">
<h2 class="col-md-5">Who We Are</h2>
<p class="col-md-8">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris ultrices urna in dui laoreet rhoncus. Vestibulum posuere mollis velit. Morbi elementum placerat erat.</p>
</div>
<div class="container page2Box col-md-12" id="box3">
<img class="image-responsive sideImage col-md-4" src="placeholder.png">
<h2 class="col-md-5">What We Do</h2>
<p class="col-md-8">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris ultrices urna in dui laoreet rhoncus. Vestibulum posuere mollis velit. Morbi elementum placerat erat.</p>
</div>
</div>
<image class="image-responsive col-md-4 mainImage" src="placeholder.png">
</body>
</html>
This is how it looks like. https://i.sstatic.net/YDkKK.jpg
Here are the problems. https://i.sstatic.net/5Ux0r.jpg