html页面小宠物代码大全,宠物店网页设计html代码
时间: 2023-08-10 19:05:36 浏览: 88
宠物商店html网站模板
以下是一个基本的宠物店网页设计的 HTML 代码示例,包含了一些可爱的小宠物:
```html
<!DOCTYPE html>
<html>
<head>
<title>宠物店</title>
<style>
body {
background-color: #F9E4B7;
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
#header {
background-color: #FFDAB9;
text-align: center;
padding: 10px;
}
#logo {
width: 150px;
height: 150px;
margin: 10px auto;
display: block;
}
#nav {
background-color: #F5DEB3;
text-align: center;
padding: 10px;
}
#nav ul {
list-style: none;
margin: 0;
padding: 0;
}
#nav li {
display: inline-block;
margin-right: 20px;
}
#nav a {
color: #000;
text-decoration: none;
font-size: 18px;
font-weight: bold;
padding: 10px;
}
#nav a:hover {
color: #FF69B4;
}
#banner {
background-image: url(pet_banner.jpg);
background-size: cover;
height: 300px;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
#banner h1 {
color: #FFF;
font-size: 48px;
text-shadow: 2px 2px #000;
margin: 0;
padding: 0;
}
#content {
padding: 20px;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;
}
.pet {
background-color: #FFF;
margin: 10px;
box-shadow: 2px 2px 5px #888;
text-align: center;
padding: 20px;
width: 200px;
height: 300px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.pet img {
width: 150px;
height: 150px;
margin-bottom: 10px;
}
.pet h2 {
font-size: 24px;
color: #FF69B4;
margin: 0;
padding: 0;
}
.pet p {
color: #000;
font-size: 16px;
margin: 0;
padding: 0;
}
#footer {
background-color: #FFDAB9;
text-align: center;
padding: 10px;
}
#footer p {
color: #000;
font-size: 14px;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="header">
<img src="pet_logo.png" alt="宠物店" id="logo">
</div>
<div id="nav">
<ul>
<li><a href="#">首页</a></li>
<li><a href="#">宠物狗</a></li>
<li><a href="#">宠物猫</a></li>
<li><a href="#">宠物鸟</a></li>
<li><a href="#">小宠物</a></li>
<li><a href="#">关于我们</a></li>
</ul>
</div>
<div id="banner">
<h1>欢迎来到宠物店!</h1>
</div>
<div id="content">
<div class="pet">
<img src="pet_dog1.jpg" alt="宠物狗">
<h2>金毛犬</h2>
<p>男孩喜欢的狗狗,活泼可爱,温顺不咬人。</p>
</div>
<div class="pet">
<img src="pet_cat1.jpg" alt="宠物猫">
<h2>美国短毛猫</h2>
<p>漂亮的猫咪,温柔可人,适合家庭养殖。</p>
</div>
<div class="pet">
<img src="pet_bird1.jpg" alt="宠物鸟">
<h2>凤头鹦鹉</h2>
<p>可爱的小鸟,喜欢人类,善于学习说话。</p>
</div>
<div class="pet">
<img src="pet_hamster1.jpg" alt="小宠物">
<h2>仓鼠</h2>
<p>小巧可爱的宠物,适合公寓和小房子。</p>
</div>
</div>
<div id="footer">
<p>© 2021 宠物店</p>
</div>
</body>
</html>
```
你可以根据需要进行修改或添加其他元素。
阅读全文