I want to have a div in the center of the window and place another one right next to it without moving it.
Right now I have:
.wrapper { display: flex; flex-wrap: wrap; justify-content: center; align-items: center;}.centered { text-align: center;}
<div class="wrapper"><div class="draw-area centered"></div><div class="result centered"></div></div>
With this code the divs are centered horizontally and vertically, but the div with class draw-area
is not exactly in the middle of the window because of the div with class result
. Can someone please help me? Is flexbox the wrong tool to use here?
Edit:Here is more of my code for more context:
<div class="wrapper"><div class="draw-area centered"><div class="canvas-container"><canvas id="canvasPosition" class="canvasDrawing" height="400" , width="400"></canvas></div><div class="button-container"><button id="clearDrawing" onclick="clearArea()">Clear Area</button><button id="submitDrawing" onclick="sendImage()">Submit</button></div></div><div class="result centered"><img id="resizedImage" src="/backend/example_images/0.png" alt="Received Image"></div></div>
I want the image to be next to the canvas.