首页:包括商品搜索、分类、优惠推荐、购物车、我的、用户评价、到家服务。并添加样式
时间: 2023-07-10 14:28:42 浏览: 49
好的,您可以将以下 CSS 样式添加到您的网站样式表中,以实现上述功能的样式效果:
```css
/* 商品搜索 */
.search-box {
display: flex;
align-items: center;
justify-content: center;
width: 300px;
height: 30px;
border: 1px solid #ccc;
border-radius: 15px;
overflow: hidden;
}
.search-box input[type="text"] {
width: 250px;
height: 100%;
border: none;
outline: none;
font-size: 14px;
padding-left: 10px;
padding-right: 10px;
}
.search-box button {
width: 50px;
height: 100%;
border: none;
outline: none;
background-color: #f60;
color: #fff;
font-size: 14px;
cursor: pointer;
}
/* 分类 */
.category {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 50px;
background-color: #f5f5f5;
}
.category ul {
display: flex;
align-items: center;
justify-content: center;
list-style: none;
margin: 0;
padding: 0;
}
.category li {
margin-right: 20px;
}
.category li:last-child {
margin-right: 0;
}
.category li a {
color: #333;
font-size: 14px;
text-decoration: none;
}
.category li.active a {
color: #f60;
font-weight: bold;
}
/* 优惠推荐 */
.discount {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100px;
background-color: #fff;
}
.discount .item {
display: flex;
align-items: center;
justify-content: center;
width: 200px;
height: 80px;
border: 1px solid #ccc;
border-radius: 10px;
margin-right: 20px;
}
.discount .item:last-child {
margin-right: 0;
}
.discount .item img {
width: 60px;
height: 60px;
margin-right: 10px;
}
.discount .item .title {
font-size: 14px;
font-weight: bold;
margin-bottom: 5px;
}
.discount .item .price {
font-size: 12px;
color: #f60;
}
/* 购物车、我的、用户评价、到家服务 */
.nav {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 50px;
background-color: #333;
color: #fff;
font-size: 14px;
}
.nav a {
color: #fff;
text-decoration: none;
}
.nav a:hover {
text-decoration: underline;
}
.nav .cart,
.nav .mine,
.nav .evaluate,
.nav .service {
display: flex;
align-items: center;
justify-content: center;
width: 80px;
height: 100%;
}
.nav .cart .icon,
.nav .mine .icon,
.nav .evaluate .icon,
.nav .service .icon {
display: block;
width: 20px;
height: 20px;
margin-right: 5px;
background-repeat: no-repeat;
background-position: center center;
background-size: contain;
}
.nav .cart .icon {
background-image: url('购物车图标的路径');
}
.nav .mine .icon {
background-image: url('我的图标的路径');
}
.nav .evaluate .icon {
background-image: url('用户评价图标的路径');
}
.nav .service .icon {
background-image: url('到家服务图标的路径');
}
```
同时,您需要将上述 CSS 样式中的图片路径替换为您网站上相应的图片路径。