I am working on this webpage for a homework/lab assignment and I came across this issue.
I want my 3 div's inside a container div to be spaced and ordered correctly. I want the left and right divs to be smaller in width but the same height as the middle div. The middle div is wider in width than the left and right divs but the same height. The left and right divs have images inside. So essentially, I want ads to the sides of the middle div and the middle div is the main content.
The problem is that the images (which are very big screenshots) aren't aligning and fitting within the left and right divs as ads. The images are aligned on top of each other rather than at the left and right sides.
How can I fix this so that the webpage is responsive and placed to the desired locations? CSS solution preferred.
Link to the webpage in progress: http://techteach.us/Web2020/ZWeiJian/WCP/Lab_1.html
#cntnt {
max-width: 100%;
height: auto;
margin: 0 auto;
display: flex;
background-color: aqua;
}
#leftSideBar {
background-color: red;
max-width: 33.33%;
height: auto;
position: static;
float: left;
margin: auto;
}
#rightSideBar {
background-color: purple;
max-width: 33.33%;
height: auto;
position: static;
float: right;
margin: auto;
}
#midContent {
display: block;
width: 33.33%;
height: auto;
position: static;
float: none;
margin: auto;
}
<div id="cntnt">
<div id="leftSideBar">
<!--Techteach.us/Mrs. Ramirez's website-->
<img
src="../Visual Content/Teachteach.us.png"
alt="An ad of Techteach.us, the parent site of all Web2020 sites."
id="leftPic"
/>
</div>
<div id="midContent">
<p>
Currently under construction. Please be patient for the final
product. Thank you.
</p>
</div>
<div id="rightSideBar">
<!--ITHS' website-->
<img
src="../Visual Content/ITHS.net.png"
alt="An ad of Informational Technology High School, a High School."
id="rightPic"
/>
</div>
<br style="clear: left;" />
</div>
<br />