Certainly! I'll create a simplified version of a responsive vacation rental listing layout utilizing flexbox. The design will adapt gracefully from desktop to mobile views. Please note that for a real-world application, you'd want to use separate CSS files to keep things organized, but I'll include the CSS inline as per your request.
HTML layout with embedded CSS and property image placeholders:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vacation Rental Listing</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: 'Arial', sans-serif;
background-color: #f4f4f4;
color: #333;
line-height: 1.6;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 15px;
}
.header {
text-align: center;
padding: 20px 0;
background-color: #fff;
}
.navbar {
display: flex;
justify-content: center;
align-items: center;
padding: 20px 0;
}
.navbar a {
text-decoration: none;
color: #333;
padding: 0 10px;
}
.navbar a:hover {
color: #007bff;
}
.main {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
padding: 20px 0;
}
.rental-item {
background-color: #fff;
border: 1px solid #ddd;
margin-bottom: 20px;
width: 48%;
box-shadow: 0 2px 5px rgba(0,0,0,.1);
}
.rental-image-wrapper {
overflow: hidden;
}
.rental-image {
width: 100%;
height: auto;
transition: transform 0.3s ease-in-out;
}
.rental-image:hover {
transform: scale(1.1);
}
.rental-content {
padding: 10px;
}
.rental-title {
font-size: 20px;
margin-bottom: 10px;
}
.rental-description {
font-size: 16px;
color: #666;
}
.footer {
background-color: #333;
color: #fff;
text-align: center;
padding: 20px 0;
}
@media (max-width: 768px) {
.main {
flex-direction: column;
}
.rental-item {
width: 100%;
}
}
</style>
</head>
<body>
<div class="container">
<header class="header">
<h1>Vacation Rentals</h1>
</header>
<nav class="navbar">
<a href="#">Home</a>
<a href="#">Destinations</a>
<a href="#">Special Deals</a>
<a href="#">Contact Us</a>
</nav>
<main class="main">
<!-- Rental Item 1 -->
<div class="rental-item">
<div class="rental-image-wrapper">
<img class="rental-image" src="https://img.trackhs.com/x560/https://track-pm.s3.amazonaws.com/advancedlodging/image/69fb4619-da29-4c85-a5ec-b8744597fc42" alt="Rental Property">
</div>
<div class="rental-content">
<h2 class="rental-title">Ocean View Beach House</h2>
<p class="rental-description">Enjoy breathtaking views from this stunning beach house with all the amenities you could wish for a perfect vacation.</p>
</div>
</div>
<!-- Rental Item 2 -->
<!-- Add more rental items here following the same pattern -->
</main>
<footer class="footer">
<p>© 2023 Vacation Rentals, Inc.</p>
</footer>
</div>
</body>
</html>
This code snippet generates a simple layout with a navigation bar, header title, rental listings, and a footer. The image provided as an example is being used in one of the property listings. The image will scale up slightly on hover to add a subtle interaction effect.
The flex properties ensure that on desktops, the rental items are presented in a two-column layout with some space between them. On screens smaller than 768 pixels wide, such as tablets and phones, the items stack vertically and extend to the full width of the viewport.
Brighten up the page by replacing the text and URLs with your actual content and images for a more polished result.