[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-AmuQIf9B-1691944172572)(assets/1680342815532.png)]
<link rel="stylesheet" href="./iconfont/iconfont.css">
<link rel="stylesheet" href="./css/base.css">
<link rel="stylesheet" href="./css/common.css">
<link rel="stylesheet" href="./css/index.css">
SEO:搜索引擎优化,提升网站百度搜索排名
提升SEO的常见方法:
网页头部 SEO 标签:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-q6PPQaoY-1691944172573)(assets/1680342859110.png)]
<meta name="description" content="小兔鲜儿官网,致力于打造全球最大的食品、生鲜电商购物平台。">
<meta name="keywords" content="小兔鲜儿,食品,生鲜,服装,家电,电商,购物">
<title>小兔鲜儿-新鲜、惠民、快捷!title>
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-NNNJIyni-1691944172574)(assets/1680342897355.png)]
Favicon 图标:网页图标,出现在浏览器标题栏,增加网站辨识度。
图标:favicon.ico,一般存放到网站的根目录里面
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-yW8plKht-1691944172575)(assets/1680342907910.png)]
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
common.css
/* 版心 */
.wrapper {
margin: 0 auto;
width: 1240px;
}
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-MDHpgWVg-1691944172576)(assets/1680343012434.png)]
<div class="shortcut">
<div class="wrapper">1div>
div>
/* 快捷导航 */
.shortcut {
height: 52px;
background-color: #333;
}
.shortcut .wrapper {
display: flex;
justify-content: flex-end;
height: 52px;
background-color: pink;
}
<ul>
<li><a href="#" class="login">请先登录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="#"><span class="iconfont icon-mobile-phone">span>手机版a>li>
ul>
.shortcut ul {
display: flex;
line-height: 52px;
}
.shortcut li a {
padding: 0 15px;
border-right: 1px solid #999;
font-size: 14px;
color: #fff;
}
.shortcut li:last-child a {
border-right: 0;
}
.shortcut li .iconfont {
margin-right: 4px;
vertical-align: middle;
}
.shortcut li .login {
color: #5EB69C;
}
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-DhjYY6WG-1691944172577)(assets/1680343169749.png)]
<div class="header wrapper">
<div class="logo">logodiv>
<div class="nav">导航div>
<div class="search">搜索div>
<div class="cart">购物车div>
div>
/* 头部 */
.header {
display: flex;
margin-top: 22px;
margin-bottom: 22px;
height: 88px;
background-color: pink;
}
<div class="logo">
<h1><a href="#">小兔鲜儿a>h1>
div>
/* logo */
.logo {
margin-right: 40px;
width: 200px;
height: 88px;
/* background-color: skyblue; */
}
.logo a {
display: block;
width: 200px;
height: 88px;
background-image: url(../images/logo.png);
font-size: 0;
}
<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>
<li><a href="#">服装a>li>
ul>
/* 导航 */
.nav {
margin-top: 33px;
margin-right: 28px;
}
.nav ul {
display: flex;
}
.nav li {
margin-right: 47px;
}
.nav li a {
padding-bottom: 10px;
/* background-color: skyblue; */
}
.nav li a:hover {
border-bottom: 2px solid #5EB69C;
color: #5EB69C;
}
<div class="search">
<span class="iconfont icon-search">span>
<input type="text" placeholder="搜一搜">
div>
/* 搜索 */
.search {
display: flex;
margin-top: 33px;
margin-right: 45px;
width: 170px;
height: 34px;
border-bottom: 2px solid #F4F4F4;
}
.search .iconfont {
margin-right: 8px;
font-size: 18px;
color: #ccc;
}
.search input {
/* 浏览器优先生效 input 标签的默认宽度,所以 flex:1 不生效 */
/* 解决办法:重置 input 默认宽度 → width:0 */
flex: 1;
width: 0;
}
.search input::placeholder {
font-size: 16px;
color: #ccc;
}
<div class="cart">
<span class="iconfont icon-cart-full">span>
<i>2i>
div>
/* 购物车 */
.cart {
position: relative;
margin-top: 32px;
}
.cart .iconfont {
font-size: 24px;
}
.cart i {
position: absolute;
top: 1px;
/* right 定位右对齐:如果文字多了,向左撑开,可能盖住其他的内容 */
/* right: 1px; */
/* left 定位左对齐:文字多了,向右撑开 */
left: 15px;
padding: 0 6px;
height: 15px;
background-color: #E26237;
border-radius: 8px;
font-size: 14px;
color: #FFFEFE;
line-height: 15px;
}
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-JKGcyDMg-1691944172577)(assets/1680343743595.png)]
<div class="footer">
<div class="wrapper">
<div class="service">服务div>
<div class="help">帮助中心div>
<div class="copyright">版权div>
div>
div>
/* 底部 */
.footer {
height: 580px;
background-color: #F5F5F5;
}
/* 服务 */
.service {
padding: 60px 0;
height: 178px;
border-bottom: 1px solid #E8E8E8;
}
/* 帮助中心 */
.help {
display: flex;
justify-content: space-between;
padding-top: 60px;
height: 300px;
background-color: pink;
}
<ul>
<li>
<h5>h5>
<p>价格亲民p>
li>
<li>
<h5>h5>
<p>物流快捷p>
li>
<li>
<h5>h5>
<p>品质新鲜p>
li>
<li>
<h5>h5>
<p>售后无忧p>
li>
ul>
.service ul {
display: flex;
justify-content: space-evenly;
}
.service li {
display: flex;
width: 190px;
height: 58px;
/* background-color: pink; */
}
.service li h5 {
margin-right: 20px;
width: 58px;
height: 58px;
background-image: url(../images/sprite.png);
}
.service li p {
font-size: 28px;
line-height: 58px;
}
.service li:nth-child(2) h5 {
background-position: 0 -58px;
}
.service li:nth-child(3) h5 {
background-position: 0 -116px;
}
.service li:nth-child(4) h5 {
background-position: 0 -174px;
}
<div class="left">
<dl>
<dt>购物指南dt>
<dd><a href="#">购物流程a>dd>
<dd><a href="#">支付方式a>dd>
<dd><a href="#">售后规则a>dd>
dl>
<dl>
<dt>配送方式dt>
<dd><a href="#">配送运费a>dd>
<dd><a href="#">配送范围a>dd>
<dd><a href="#">配送时间a>dd>
dl>
<dl>
<dt>关于我们dt>
<dd><a href="#">平台规则a>dd>
<dd><a href="#">联系我们a>dd>
<dd><a href="#">问题反馈a>dd>
dl>
<dl>
<dt>售后服务dt>
<dd><a href="#">售后政策a>dd>
<dd><a href="#">退款说明a>dd>
<dd><a href="#">取消订单a>dd>
dl>
<dl>
<dt>服务热线dt>
<dd><a href="#">在线客服<span class="iconfont icon-customer-service">span>a>dd>
<dd><a href="#">客服电话 400-0000-000a>dd>
<dd><a href="#">工作时间 周一至周日 8:00-18:00a>dd>
dl>
div>
/* left */
.help .left {
display: flex;
}
.help .left dl {
margin-right: 84px;
}
.help .left dl:last-child {
margin-right: 0;
}
.help .left dt {
margin-bottom: 30px;
font-size: 18px;
}
.help .left dd {
margin-bottom: 10px;
}
.help .left a {
color: #969696;
}
.help .left .iconfont {
color: #5EB69C;
}
<div class="right">
<ul>
<li>
<div class="pic"><img src="./images/wechat.png" alt="">div>
<p>微信公众号p>
li>
<li>
<div class="pic"><img src="./images/app.png" alt="">div>
<p>APP下载二维码p>
li>
ul>
div>
/* right */
.help .right ul {
display: flex;
}
.help .right li:first-child {
margin-right: 55px;
}
.help .right .pic {
margin-bottom: 10px;
width: 120px;
height: 120px;
}
.help .right p {
color: #969696;
text-align: center;
}
<p>
<a href="#">关于我们a>|
<a href="#">帮助中心a>|
<a href="#">售后服务a>|
<a href="#">配送与验收a>|
<a href="#">商务合作a>|
<a href="#">搜索推荐a>|
<a href="#">友情链接a>
p>
<p>CopyRight © 小兔鲜p>
/* 版权 */
.copyright {
text-align: center;
}
.copyright p {
margin-bottom: 10px;
color: #A1A1A1;
}
.copyright p a {
margin: 0 10px;
color: #A1A1A1;
}