You should really consider learning CSS flex and grid. using float to align divs is not the best practice in 2021.
I have added display: flex
to .mc-info
and removed all the float properties and max-width:100%
to auto scale.
.mc-info {
display: flex;
}
.mc-info-image {
max-width: 800px;
}
img {
max-width: 100%;
}
.info-wrapper {
padding-left: 20px;
}
And lastly wrapped the car information in <div class="info-wrapper"> </div>
Final code
<!DOCTYPE html>
<html>
<meta charset="utf-8" />
<head>
<body>
<title>YourLeisure Motorhomes & Caravans</title>
<style>
.header {
background-color: #333;
color: #FFF;
padding: 30px;
}
.content {
width: 750px;
}
.mc-info {
display: flex;
height: auto;
border: 2px solid;
max-width: 800px;
height: auto;
margin-top: 20px;
margin-bottom: 20px;
}
.mc-info-image {
max-width: 800px;
}
.mc-info-image img {
margin-right: 29px;
height: 340px;
}
.description {
font-size: 16px;
float: right;
}
.vehiname {
font-size: 18px;
color: green;
}
.price {
color: red;
}
footer {
color: #333;
background-color: blue;
}
img {
max-width: 100%;
}
.info-wrapper {
padding-left: 20px;
}
</style>
</head>
<body>
<div class="header">
<h1>YOURLEISURE MOTORHOMES</h1>
<h2>49 High Street, Northtown</h2>
</div>
<div class="content">
<div class="mc-info">
<div class="mc-info-image">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/b/b4/VW_T5_California_front_20071215.jpg/800px-VW_T5_California_front_20071215.jpg">
</div>
<div class="info-wrapper">
<div class="vehiname">
<h2>VOLKSWAGEN CALIFORNIA 2.0 BITDI 180</h2>
</div>
<div class="price">
<h2>£45,000</h2>
</div>
<div class="description">
This example has all the equipment you could want
</div>
</div>
</div>
<div class="mc-info">
<div class="mc-info-image">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/74/Ford_Transit_FT_130_Camper_%2818418440689%29.jpg/1024px-Ford_Transit_FT_130_Camper_%2818418440689%29.jpg">
</div>
<div class="info-wrapper">
<div class="vehiname">
<h2>FORD TRANSIT CAMPERVAN 2.0</h2>
</div>
<div class="price">
<h2>£1,000</h2>
</div>
<div class="description">
red/white
</div>
</div>
</div>
<footer>
Content to come
</footer>
</body>
</html>