Creating a website like Apple's in a single HTML file is a challenging task, as their website is built using a combination of HTML, CSS, JavaScript, and server-side technologies. However, I can provide you with a basic structure and design that resembles Apple's website. Please note that this will be a simplified version and not an exact replica.
Here is an example of a single HTML file that attempts to mimic the UI of Apple's website:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Apple</title>
<style>
/* Global Styles */
body {
font-family: 'SF Pro', sans-serif;
margin: 0;
padding: 0;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.header {
background-color: #f7f7f7;
padding: 20px;
text-align: center;
}
.header nav ul {
list-style: none;
margin: 0;
padding: 0;
display: flex;
justify-content: space-between;
}
.header nav ul li {
margin-right: 20px;
}
.header nav a {
text-decoration: none;
color: #333;
}
.hero {
background-image: linear-gradient(to bottom, #fff, #f7f7f7);
padding: 100px 20px;
text-align: center;
}
.hero h1 {
font-size: 48px;
margin-bottom: 20px;
}
.hero p {
font-size: 18px;
margin-bottom: 40px;
}
.products {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.product {
margin: 20px;
width: calc(33.33% - 20px);
}
.product img {
width: 100%;
height: 150px;
object-fit: cover;
border-radius: 10px;
}
.product h2 {
font-size: 18px;
margin-top: 10px;
}
.product p {
font-size: 14px;
margin-bottom: 20px;
}
.footer {
background-color: #f7f7f7;
padding: 20px;
text-align: center;
}
</style>
</head>
<body>
<header class="header">
<nav>
<ul>
<li><a href="#">Mac</a></li>
<li><a href="#">iPad</a></li>
<li><a href="#">iPhone</a></li>
<li><a href="#">Watch</a></li>
<li><a href="#">AirPods</a></li>
<li><a href="#">TV & Home</a></li>
<li><a href="#">Only on Apple</a></li>
</ul>
</nav>
</header>
<section class="hero">
<h1>Welcome to Apple</h1>
<p>Explore our latest products and innovations</p>
<button>Learn More</button>
</section>
<section class="products">
<div class="product">
<img src="https://via.placeholder.com/300" alt="Product 1">
<h2>MacBook Air</h2>
<p>Starting at $999</p>
</div>
<div class="product">
<img src="https://via.placeholder.com/300" alt="Product 2">
<h2>iPad Pro</h2>
<p>Starting at $899</p>
</div>
<div class="product">
<img src="https://via.placeholder.com/300" alt="Product 3">
<h2>iPhone 13</h2>
<p>Starting at $599</p>
</div>
<div class="product">
<img src="https://via.placeholder.com/300" alt="Product 4">
<h2>Apple Watch</h2>
<p>Starting at $399</p>
</div>
<div class="product">
<img src="https://via.placeholder.com/300" alt="Product 5">
<h2>AirPods Pro</h2>
<p>Starting at $249</p>
</div>
<div class="product">
<img src="https://via.placeholder.com/300" alt="Product 6">
<h2>Apple TV</h2>
<p>Starting at $149</p>
</div>
</section>
<footer class="footer">
<p>© 2023 Apple Inc. All rights reserved.</p>
</footer>
</body>
</html>
This code creates a basic structure with a header, hero section, products section, and footer. The styles are inspired by Apple's website, but keep in mind that this is a simplified version and not an exact replica.
Please note that you'll need to replace the placeholder images with actual images and update the content to match your needs. Additionally, this code does not include any JavaScript or server-side functionality, which is used extensively on Apple's website.
I hope this helps! Let me know if you have any questions or need further assistance.