I'm trying to keep all of my elements centered in my page, but whenever I resize my web browser everything turns into a squashed mess. I've been trying to deal with this problem for a couple of days now, but nothing I've done seems to work. I've looked at a lot of sources to see what the problem is (looking up youtube tutorials, making sure all my measurements were in pixels, using wrappers, etc). I'm new to coding (only about a month in), so I'm most definitely overlooking something.
This is how I want my website to look
This is an example of how my website looks when the page is resized
Here's my HTML:
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>J and R Rentals</title>
<link rel="stylesheet" href="css/styles.css">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap" rel="stylesheet">
</head>
<body class= "body">
<div class="top-container">
<div id="wrapper">
<h1 class="title">J and R Rentals</h1>
<p class="motto">Tired of old broken down rentals? You deserve to rent a brand new one.</p>
<img class="trees-one" src="002-rural-1.png" alt="">
<img class="trees-two" src="001-rural.png" alt="">
<img class="clouds-one" src="clouds.png" alt="">
<img class="clouds-two" src="clouds.png" alt="">
<img class="mountain-one" src="mountain.png" alt="">
<img class="trees-three" src="001-rural.png" alt="">
<img class="forest-one" src="forest.png" alt="">
<img class="house-one" src="residential.png" alt="">
<img class="house-two" src="residential-1.png" alt="">
</div>
</div>
and here's my CSS:
#wrapper {
background-color: #cffffe;
margin: 0 auto;
margin-bottom: 30px;
padding-top: 400px;
}
.body {
margin: 0;
}
.title {
color: #0f4c75;
font-size: 70px;
text-align: center;
position: relative;
bottom: 350px;
font-family: 'Roboto', sans-serif;
}
.motto {
color: #0f4c75;
font-size: 40px;
text-align: center;
position: relative;
bottom: 350px;
font-family: 'Roboto', sans-serif;
}
.trees-one {
position: absolute;
bottom: 343px;
width: 300px;
}
.trees-two {
position: absolute;
width: 300px;
bottom: 343px;
right: 0px;
}
.clouds-one {
position: absolute;
width: 200px;
top: 40px;
left: 200px;
}
.clouds-two {
position: absolute;
width: 200px;
top: 40px;
right: 200px;
}
.mountain-one {
position: absolute;
width: 300px;
bottom: 343px;
right: 300px;
}
.trees-three {
position: absolute;
width: 300px;
bottom: 343px;
left: 300px;
}
.house-one {
position: absolute;
width: 300px;
bottom: 343px;
left: 600px;
}
.house-two {
position: absolute;
width: 300px;
bottom: 343px;
right: 600px;
}
.forest-one {
position: absolute;
width: 355px;
bottom: 343px;
right: 800px;
}
I'd really appreciate any help I can get; thank you in advance!