When the screen is maximized everything looks great, but when I minimize it, the content doesn't center. I tried using margin: auto; in the "main-div" class, but then everything shifted to the top left corner. So, I added a "wrapper-div" to contain the main div and align it, but it doesn't seem to be working as expected.
There seems to be something at the top that I can't quite figure out. Click here for image description
body {
background-color: hsl(30, 38%, 92%);
}
table {
border-radius: 20px;
overflow: hidden;
border-collapse: collapse;
}
.wrapper-div {
width: auto;
margin: auto;
}
.main-div {
width: fit-content;
margin: 135px 470px;
position: absolute;
}
<body>
<div class="wrapper-div">
<div class="main-div">
<table cellpadding="0">
<tr class="parent-row">
<td class="img-container">
<img src="images/image-product-desktop.jpg" alt="image-product-desktop-version" />
</td>
<td class="text-container">
<h3 class="title1">PERFUME</h3>
<h2 class="title2"><b>Gabrielle Essence Eau De Parfum</b></h2>
<p class="description-text">
A floral, solar and voluptuous interpretation composed by Olivier Polge, Perfumer-Creator for the House of CHANEL.
</p>
<div class="both-prices">
<h2 class="new-price">$149.99</h2>
<h4 class="old-price">$169.99</h4>
</div>
<a class="cart-btn" href="#"><span></span>Add to cart</a>
</td>
</tr>
</table>
</div>
</div>
</body>