生成一个买花的网站主页静态代码
时间: 2024-04-22 15:21:56 浏览: 8
很高兴为您提供帮助。以下是一个简单的买花网站的主页静态代码示例:
```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;
}
header {
background-color: #ffdab9;
padding: 20px;
text-align: center;
}
h1 {
font-size: 36px;
margin: 0;
}
nav {
background-color: #ffa07a;
display: flex;
justify-content: center;
padding: 10px;
}
nav a {
color: #fff;
padding: 10px;
text-decoration: none;
}
nav a:hover {
background-color: #fff;
color: #ffa07a;
border-radius: 5px;
}
main {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin: 20px;
}
article {
background-color: #fff;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
margin: 10px;
padding: 20px;
text-align: center;
width: 300px;
}
article h2 {
font-size: 24px;
margin: 0;
}
article p {
font-size: 18px;
margin: 10px 0;
}
article button {
background-color: #ffa07a;
border: none;
border-radius: 5px;
color: #fff;
cursor: pointer;
font-size: 18px;
margin-top: 10px;
padding: 10px;
transition: background-color 0.3s ease;
}
article button:hover {
background-color: #ff7f50;
}
</style>
</head>
<body>
<header>
<h1>买花网站</h1>
</header>
<nav>
<a href="#">首页</a>
<a href="#">鲜花</a>
<a href="#">花篮</a>
<a href="#">花束</a>
<a href="#">联系我们</a>
</nav>
<main>
<article>
<h2>红玫瑰</h2>
<img src="https://via.placeholder.com/300x200" alt="红玫瑰">
<p>价格:20元/支</p>
<button>购买</button>
</article>
<article>
<h2>百合</h2>
<img src="https://via.placeholder.com/300x200" alt="百合">
<p>价格:30元/支</p>
<button>购买</button>
</article>
<article>
<h2>康乃馨</h2>
<img src="https://via.placeholder.com/300x200" alt="康乃馨">
<p>价格:15元/支</p>
<button>购买</button>
</article>
<article>
<h2>向日葵</h2>
<img src="https://via.placeholder.com/300x200" alt="向日葵">
<p>价格:25元/支</p>
<button>购买</button>
</article>
</main>
</body>
</html>
```
这个示例网页包括一个带有标题的页眉,一个带有链接的导航栏,以及一些花的文章,包括标题、图片、价格和购买按钮。您可以根据自己的需求进行修改和定制。