I am not allowed to use bootstrap for this.
Here is my HTML
<section class="blog">
<div class="wrapper">
<h2>Blog</h2>
<div class="container">
<div class="sub-container">
<div class="top-sub-container">
<div class="box box-1">
<img src="myimage.jpg" />
<div class="box-text">
<p>DATE</p>
<h3>Title</h3>
<p>Lorem ipsum</p>
<button class="button">Read More</button>
</div>
</div>
<div class="box box-2">
<img src="myimage.jpg" />
<div class="box-text">
<p>Date</p>
<h3>Title</h3>
<p>Lorem ipsum dolor</p>
<button class="button">Read More</button>
</div>
</div>
</div>
<div class="box box-3">
<img src="myimage.jpg" />
<div class="box-text">
<p>Date</p>
<h3>Title</h3>
<p>Lorem ipsum dolor sit</p>
<button class="button">Read More</button>
</div>
</div>
</div>
<div class="box box-4">
<img src="myimage.jpg" />
<div class="box-text4">
<h3>About Me</h3>
<p>Lorem ipsum dolor.</p>
</div>
</div>
</div>
And then here is my CSS:
.container {
display: flex;
gap: 3.5rem;
height: 30rem;
width: 30rem;
padding-left: 175px;
padding-top: 50px;
/* background: pink; */
}
.top-sub-container {
flex: 1 1 auto;
display: flex;
gap: 3.5rem;
}
.sub-container {
flex: 1 1 auto;
display: flex;
gap: 3.5rem;
flex-direction: column;
}
.box {
display: flex;
flex: 1 1 auto;
flex-direction: column;
/* padding: 25px; */
}
.post-text {
padding: 10px;
background-color: white;
color: #D64C31;
width: 250px;
height: 250px;
}
.box-text4 {
background-color: #7C7D98;
padding: 20px;
color: white;
}
.box-text {
padding: 20px;
color: white;
background-color: #4A455C
}
When I shrink my browser window, the content stays put instead of narrowing/stacking on top of each other.
If you need to see more of my code, please let me know. I'm very confused. I also can not center my code inside the wrapper so I used "padding-left: 175px". I think this is incorrect. I tried to utilize "justify-content: center;" but it did not work. What am I doing wrong?