写一个html关于卖手机的网页
<!DOCTYPE html>
<html>
<head>
<title>手机专卖店</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
<pre><code> header {
background-color: #333;
color: #fff;
display: flex;
align-items: center;
justify-content: space-around;
padding: 10px;
}
header h1 {
margin: 0;
font-size: 36px;
}
nav {
background-color: #f2f2f2;
display: flex;
justify-content: space-around;
padding: 10px;
}
nav a {
text-decoration: none;
color: #333;
font-size: 24px;
margin: 0 20px;
}
nav a:hover {
color: #f00;
}
section {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
align-items: flex-start;
padding: 20px;
}
.card {
background-color: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
margin: 20px;
width: 300px;
text-align: center;
padding: 20px;
}
.card img {
max-width: 100%;
height: auto;
margin-bottom: 10px;
}
.card h2 {
font-size: 24px;
margin: 10px 0;
}
.card p {
font-size: 18px;
margin: 10px 0;
}
.card button {
background-color: #f00;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
font-size: 18px;
cursor: pointer;
}
.card button:hover {
background-color: #333;
}
footer {
background-color: #333;
color: #fff;
text-align: center;
padding: 10px;
}
</style>
</code></pre>
</head>
<body>
<header>
<h1>手机专卖店</h1>
<form>
<input type="text" placeholder="搜索...">
<button type="submit">搜索</button>
</form>
</header>
<pre><code><nav>
<a href="#">首页</a>
<a href="#">苹果</a>
<a href="#">华为</a>
<a href="#">小米</a>
<a href="#">三星</a>
<a href="#">联系我们</a>
</nav>
<section>
<div class="card">
<img src="https://cdn.pixabay.com/photo/2017/08/06/14/00/smartphone-2590578_960_720.jpg" alt="手机">
<h2>苹果 iPhone X</h2>
<p>64GB 存储 / 银色</p>
<p>价格:7999元</p>
<button>立即购买</button>
</div>
<div class="card">
<img src="https://cdn.pixabay.com/photo/2016/12/09/11/33/smartphone-1894723_960_720.jpg" alt="手机">
<h2>华为 Mate 30 Pro</h2>
<p>128GB 存储 / 青山绿</p>
<p>价格:5999元</p>
<button>立即购买</button>
</div>
<div class="card">
<img src="https://cdn.pixabay.com/photo/2017/08/06/14/00/smartphone-2590578_960_720.jpg" alt="手机">
<h2>小米 10</h2>
<p>256GB 存储 / 钛银黑</p>
<p>价格:3999元</p>
<button>立即购买</button>
</div>
<div class="card">
<img src="https://cdn.pixabay.com/photo/2016/12/09/11/33/smartphone-1894723_960_720.jpg" alt="手机">
<h2>三星 Galaxy S20</h2>
<p>256GB 存储 / 云霄蓝</p>
<p>价格:7999元</p>
<button>立即购买</button>
</div>
</section>
<footer>
<p>&copy; 2021 手机专卖店</p>
</footer>
</code></pre>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/bIcp 著作权归作者所有。请勿转载和采集!