天猫旗舰店html+css
时间: 2023-12-11 09:32:56 浏览: 93
以下是一个简单的天猫旗舰店的HTML和CSS示例,包括一个主页和一个产品列表页面:
HTML代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>Tmall旗舰店</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<div class="logo">
<img src="https://img.alicdn.com/tfs/TB1JZJ6XpzqK1RjSZFvXXcB7VXa-183-47.png" alt="Tmall">
</div>
<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>
<li><a href="#">数码</a></li>
<li><a href="#">家电</a></li>
</ul>
</nav>
<div class="search">
<input type="text" placeholder="搜索">
<button>搜索</button>
</div>
</header>
<main>
<div class="banner">
<img src="https://img.alicdn.com/tfs/TB1JZJ6XpzqK1RjSZFvXXcB7VXa-183-47.png" alt="Tmall">
</div>
<div class="products">
<ul>
<li>
<a href="#">
<img src="https://img.alicdn.com/tfs/TB1JZJ6XpzqK1RjSZFvXXcB7VXa-183-47.png" alt="商品1">
<h3>商品1</h3>
<p>¥100</p>
</a>
</li>
<li>
<a href="#">
<img src="https://img.alicdn.com/tfs/TB1JZJ6XpzqK1RjSZFvXXcB7VXa-183-47.png" alt="商品2">
<h3>商品2</h3>
<p>¥200</p>
</a>
</li>
<li>
<a href="#">
<img src="https://img.alicdn.com/tfs/TB1JZJ6XpzqK1RjSZFvXXcB7VXa-183-47.png" alt="商品3">
<h3>商品3</h3>
<p>¥300</p>
</a>
</li>
<li>
<a href="#">
<img src="https://img.alicdn.com/tfs/TB1JZJ6XpzqK1RjSZFvXXcB7VXa-183-47.png" alt="商品4">
<h3>商品4</h3>
<p>¥400</p>
</a>
</li>
</ul>
</div>
</main>
<footer>
<p>版权所有 © Tmall</p>
</footer>
</body>
</html>
```
CSS代码:
```css
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
header {
background-color: #f5f5f5;
padding: 10px;
display: flex;
align-items: center;
justify-content: space-between;
}
.logo img {
height: 30px;
}
nav ul {
list-style: none;
display: flex;
}
nav li {
margin-right: 20px;
}
nav a {
color: #333;
text-decoration: none;
}
nav a:hover {
color: #f40;
}
.search input {
padding: 5px;
border: none;
border-radius: 5px;
}
.search button {
padding: 5px 10px;
background-color: #f40;
color: #fff;
border: none;
border-radius: 5px;
margin-left: 10px;
cursor: pointer;
}
main {
padding: 20px;
}
.banner img {
width: 100%;
}
.products ul {
list-style: none;
display: flex;
flex-wrap: wrap;
}
.products li {
width: 25%;
padding: 10px;
box-sizing: border-box;
}
.products a {
display: block;
text-align: center;
color: #333;
text-decoration: none;
}
.products img {
width: 100%;
}
.products h3 {
margin: 10px 0;
font-size: 16px;
}
.products p {
color: #f40;
font-size: 18px;
}
footer {
background-color: #f5f5f5;
padding: 10px;
text-align: center;
}
```
阅读全文