The image below is what I'm currently working with. I have a flex container taking up the whole width of the screen (a div with the red border), that contains two flex items: one being the white square, and the other being another flex container (with the blue border) containing the buttons.
What I'm trying to do is center the white square horizontally on screen, and have it so that when the window/screen is resized the button container div won't collide/come into the white square. I'm not sure how to go about this, so any help would be appreciated. My code is below the image.
<div class="middle-content-section">
<div class="drawing-pad-container"></div>
<div class="settings-container">
<button class="grid-toggle-button">Show grid</button>
<button class="grid-toggle-button">Hover to draw</button>
</div>
</div>
.middle-content-section {
margin-top: 50px;
display: flex;
gap: 50px;
width: 100%;
border: 1px solid red;
}
.settings-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
gap: 20px;
border: 1px solid blue;
}
.drawing-pad-container {
height: 500px;
width: 500px;
background: rgb(255, 255, 255);
filter: drop-shadow(2px 2px 3px rgb(180, 180, 180));
transition: 0.3s;
display: grid;
grid-template-rows: repeat(30, 1fr);
grid-template-columns: repeat(30, 1fr);
flex: 0 0 auto;
}

