Sure, I'll provide you with a basic outline of how to build a clone of the Zillow listing page using HTML, CSS, and JavaScript. This is a simplified version and doesn't include all the features of the actual Zillow page, but it should give you a good starting point.
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Zillow Clone</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<div class="container">
<h1>Zillow Clone</h1>
<nav>
<ul>
<li><a href="#">Buy</a></li>
<li><a href="#">Rent</a></li>
<li><a href="#">Sell</a></li>
<li><a href="#">Mortgage</a></li>
</ul>
</nav>
</div>
</header>
<main>
<div class="container">
<section class="search-bar">
<input type="text" placeholder="Search homes...">
<button>Search</button>
</section>
<section class="listings">
<div class="listing">
<img src="house1.jpg" alt="House 1">
<div class="details">
<h2>$300,000</h2>
<p>2 bed | 1 bath | 1,000 sqft</p>
<p>123 Main St, Anytown, USA</p>
</div>
</div>
<div class="listing">
<img src="house2.jpg" alt="House 2">
<div class="details">
<h2>$350,000</h2>
<p>3 bed | 2 bath | 1,500 sqft</p>
<p>456 Elm St, Anytown, USA</p>
</div>
</div>
<!-- Add more listings as needed -->
</section>
</div>
</main>
<script src="script.js"></script>
</body>
</html>
CSS (styles.css)
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
header {
background-color: #0073e6;
color: white;
padding: 10px 0;
}
header .container {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
header h1 {
margin: 0;
}
nav ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
}
nav ul li {
margin-left: 20px;
}
nav ul li a {
color: white;
text-decoration: none;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
.search-bar {
margin: 20px 0;
}
.search-bar input {
padding: 10px;
width: calc(100% - 110px);
}
.search-bar button {
padding: 10px;
background-color: #0073e6;
color: white;
border: none;
cursor: pointer;
}
.listings {
display: flex;
flex-wrap: wrap;
}
.listing {
border: 1px solid #ccc;
margin: 10px;
flex: 1 1 calc(33.333% - 20px);
box-sizing: border-box;
}
.listing img {
width: 100%;
height: auto;
}
.details {
padding: 10px;
}
.details h2 {
margin: 0 0 10px 0;
}
.details p {
margin: 5px 0;
}
JavaScript (script.js)
For this basic clone, we don't need much JavaScript, but you can add interactivity as needed.
document.querySelector('.search-bar button').addEventListener('click', function() {
alert('Search functionality is not implemented in this clone.');
});
Images
You'll need to add some placeholder images (house1.jpg, house2.jpg, etc.) to the same directory as your HTML file or adjust the paths accordingly.
This code provides a basic structure and style for a Zillow-like listing page. You can expand upon this by adding more features, improving the design, and integrating real data.