前端——品优购项目

文章目录

  • 前端——品优购项目
    • 一、品优购项目规划
    • 二、首页
      • 公共部分(common.css)
        • 快捷导航模块
        • header模块
        • nav导航部分
        • 底部模块
      • 首页专有部分(index.css)
        • main模块
        • 推荐模块
        • 猜你喜欢模块
        • 楼层区域模块
    • 三、列表页(list)
      • 部分修改
      • 列表页主体
    • 四、注册页(register)
    • 五、域名注册与网站上传
    • 六、代码
      • base.css
      • common.css
      • index.html
      • index.css
      • list.html
      • list.css
      • register.html
      • register.css

素材:https://gitee.com/xiaoqiang001/html_css_material.git (第十一天)

一般情况下,a如果包含有宽度的盒子,a需要转换为块级元素

一、品优购项目规划



二、首页

公共部分(common.css)

快捷导航模块

header模块

nav导航部分

底部模块

首页专有部分(index.css)

main模块

推荐模块

猜你喜欢模块

实现图片的水平垂直居中对齐

楼层区域模块


三、列表页(list)

部分修改

列表页主体

当line-height设置的比高度要大时,文字显示会偏下
浮动的盒子不会遮盖文字,只会产生文字环绕效果

可以先把li的边框设置为透明色,经过在改变颜色,防止盒子大小发生变化

四、注册页(register)

注意:注册页面比较隐私,为了保护用户信息,我们不需要对当前页面做SEO优化
怎么简单怎么写

五、域名注册与网站上传

六、代码

base.css

/* 把我们所有标签的内外边距清零 */
* {margin: 0;padding: 0;/* css3盒子模型,算上padding和margin */box-sizing: border-box;
}
/* em和i斜体的文字不倾斜 */
em,
i {font-style: normal
}
/* 去掉前面小圆点 */
li {list-style: none
}img {/* border: 0;照顾低版本浏览器 如果图片外面包含了链接会有边框的问题 */border: 0;/* 取消图片底侧有空白缝隙的问题 */vertical-align: middle
}
/* 当我们鼠标经过button时,鼠标变成小手 */
button {cursor: pointer
}
/* 修改颜色 取消下划线 */
a {color: #666;text-decoration: none
}a:hover {color: #c81623
}button,
input {/* "\5B8B\4F53"就是宋体的意思(Unicode编码)这样浏览器兼容性比较好 */font-family: Microsoft YaHei, Heiti SC, tahoma, arial, Hiragino Sans GB, "\5B8B\4F53", sans-serif;/* 默认有灰色边框需要手动去掉 */border: 0;outline: none;
}body {/* css3抗锯齿形 让文字显示更加清晰 */-webkit-font-smoothing: antialiased;background-color: #fff;font: 12px/1.5 Microsoft YaHei, Heiti SC, tahoma, arial, Hiragino Sans GB, "\5B8B\4F53", sans-serif;color: #666
}
/* 隐藏 */
.hide,
.none {display: none
}
/* 清除浮动 */
.clearfix:after {visibility: hidden;clear: both;display: block;content: ".";height: 0
}.clearfix {*zoom: 1
}

common.css


/* 声明字体图标 路径要更换 */
@font-face {font-family: 'icomoon';src:  url('../fonts/icomoon.eot?tomleg');src:  url('../fonts/icomoon.eot?tomleg#iefix') format('embedded-opentype'),url('../fonts/icomoon.ttf?tomleg') format('truetype'),url('../fonts/icomoon.woff?tomleg') format('woff'),url('../fonts/icomoon.svg?tomleg#icomoon') format('svg');font-weight: normal;font-style: normal;font-display: block;}
/* 版心 */
.w {width: 1200px;margin: 0 auto;
}
.fl {float: left;
}
.fr {float: right;
}
.style_red {color: #c81623;
}
/* 快捷导航模块 */
.shortcut {height: 32px;line-height: 32px;background-color: #f1f1f1;
}
.shortcut ul li {float: left;
}
/* 选择所有偶数li */
.shortcut .fr li:nth-child(even) {width: 1px;height: 12px;background-color: #666;margin: 9px 15px 0;
}
.arrow_icon::after {content: '\e91e';font-family: 'icomoon';margin-left: 6px;
}
/* header头部制作 */
.header {position: relative;height: 105px;
}
.logo {position: absolute;top: 25px;width: 171px;height: 61px;
}
.logo a {display: block;width: 171px;height: 61px;background: url(../images/logo.png) no-repeat;font-size: 0;
}
.search {position: absolute;left: 348px;top: 25px;width: 538px;height: 36px;border: 2px solid #b1191a;
}
.search input {float: left;width: 454px;height: 32px;padding-left: 10px;
}
.search button {float: left;width: 80px;height: 32px;background-color: #c81623;font-size: 16px;color: #fff;
}
.hotwords {position: absolute;left: 348px;top: 66px;
}
.hotwords a {margin: 0 10px;
}
.shopcar {position: absolute;right: 63px;top: 25px;width: 140px;height: 35px;line-height: 35px;text-align: center;border: 1px solid #dfdfdf;background-color: #f7f7f7;
}
.shopcar::before {content: '\e93a';font-family: 'icomoon';margin-right: 5px;color: #b1191a;
}
.shopcar::after {content: '\e920';font-family: 'icomoon';margin-left: 10px;
}
.count {position: absolute;top: -5px;left: 105px;height: 14px;line-height: 14px;color: #fff;background-color: #e60012;padding: 0 5px;border-radius: 7px 7px 7px 0;
}/* nav导航部分 */
.nav {height: 47px;border-bottom: 2px solid #b1191a;
}
.nav .dropdown {float: left;width: 210px;height: 45px;background-color: #b1191a;
}
.nav .navitems {float: left;
}
.dropdown .dt {width: 100%;height: 100%;color: #fff;font-size: 16px;line-height: 45px;text-align: center;
}
.dropdown .dd {/* display: none; */width: 210px;height: 465px;background-color: #c81623;margin-top: 2px;
}
.dropdown .dd ul li {position: relative;height: 31px;line-height: 31px;margin-left: 2px;
}
.dropdown .dd ul li:hover {background-color: #fff;
}
.dropdown .dd ul li::after {position: absolute;top: 1px;right: 10px;color: #fff;content: '\e920';font-family: 'icomoon';font-size: 14px;
}
.dropdown .dd ul li:hover a {color: #c81623;
}
.dropdown .dd ul li a {font-size: 14px;color: #fff;padding-left: 10px;
}
.navitems ul li {float: left;
}
.navitems ul li a{display: block;height: 45px;line-height: 45px;font-size: 16px;padding: 0 25px;
}
/* 底部模块 */
.footer {height: 415px;padding-top: 30px;background-color: #f5f5f5;
}
.mod_service {height: 80px;border-bottom: 1px solid #ccc;
}
.mod_service ul li {float: left;width: 300px;height: 50px;padding-left: 35px;
}
.mod_service ul li h5 {float: left;width: 50px;height: 50px;background: url(../images/icons.png) no-repeat -252px -2px;margin-right: 8px;
}
.service_text h4 {font-size: 14px;
}
.service_text p {font-size: 12px;
}
.mod_help {height: 185px;border-bottom: 1px solid #ccc;padding-top: 20px;padding-left: 50px;
}
.mod_help dl {width: 200px;float: left;
}
.mod_help dl:last-child {width: 90px;text-align: center;
}
.mod_help dl dt {font-size: 16px;margin-bottom: 10px;
}
.mod_copyright {text-align: center;padding-top: 20px;
}
.links {margin-bottom: 15px;
}
.links a {margin: 0 3px;
}
.copyrights {line-height: 20px;
}

index.html

<!DOCTYPE html>
<html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>品优购商城-正品低价、品质保障、配送及时、轻松购物!</title><!-- 网站说明 --><meta name="description"content="品优购商城-专业的综合网上购物商城,销售家电、数码通讯、电脑、家居百货、服装服饰、母婴、图书、食品等数万个品牌优质商品.便捷、诚信的服务,为您提供愉悦的网上购物体验!" /><!-- 关键字 --><meta name="Keywords" content="网上购物,网上商城,手机,笔记本,电脑,MP3,CD,VCD,DV,相机,数码,配件,手表,存储卡,京东" /><!-- 引入页面favicon图标(网上在线转成ico文件放到根目录下) --><link rel="shortcut icon" href="favicon.ico"><!-- 引入初始化css文件 --><link rel="stylesheet" href="css/base.css"><!-- 引入公共样式文件 --><link rel="stylesheet" href="css/common.css"><!-- 引入index.css文件 --><link rel="stylesheet" href="css/index.css">
</head><body><!-- 快捷导航模块 start--><section class="shortcut"><div class="w"><div class="fl"><ul><li>品优购欢迎您!&nbsp;</li><li><a href="#">请登录</a> &nbsp;<a href="register.html" class="style_red">免费注册</a></li></ul></div><div class="fr"><ul><li>我的订单</li><li></li><li class="arrow_icon">我的品优购</li><li></li><li>品优购会员</li><li></li><li>企业采购</li><li></li><li class="arrow_icon">关注品优购</li><li></li><li class="arrow_icon">客户服务</li><li></li><li class="arrow_icon">网站导航</li></ul></div></div></section><!-- 快捷导航模块 end--><!-- header头部模块制作 start --><header class="header w"><!-- logo模块 --><div class="logo"><h1><a href="index.html" title="品优购商城">品优购商城</a></h1></div><!-- search模块 --><div class="search"><input type="search" name="" id="" placeholder="语言开发"><button>搜索</button></div><!-- hotwords模块 --><div class="hotwords"><a href="#" class="style_red">优惠购首发</a><a href="#">亿元优惠</a><a href="#">9.9元团购</a><a href="#">每满99减30</a><a href="#">办公用品</a><a href="#">电脑</a><a href="#">手机</a></div><!-- shopcar模块 --><div class="shopcar">我的购物车<i class="count">8</i></div></header><!-- header头部模块制作 end --><!-- nav导航部分 start --><nav class="nav"><div class="w"><div class="dropdown"><div class="dt">全部商品分类</div><div class="dd"><ul><li><a href="#">家用电器</a></li><li><a href="list.html">手机</a><a href="#">数码</a><a href="#">通信</a></li><li><a href="#">电脑</a><a href="#">办公</a></li><li><a href="#">家居</a><a href="#">家具</a><a href="#">厨具</a></li><li><a href="#">男装</a><a href="#">女装</a><a href="#">内衣</a><a href="#">童装</a></li><li><a href="#">手机</a><a href="#">数码</a><a href="#">通信</a></li><li><a href="#">手机</a><a href="#">数码</a><a href="#">通信</a></li><li><a href="#">手机</a><a href="#">数码</a><a href="#">通信</a></li><li><a href="#">手机</a><a href="#">数码</a><a href="#">通信</a></li><li><a href="#">手机</a><a href="#">数码</a><a href="#">通信</a></li><li><a href="#">手机</a><a href="#">数码</a><a href="#">通信</a></li><li><a href="#">手机</a><a href="#">数码</a><a href="#">通信</a></li><li><a href="#">手机</a><a href="#">数码</a><a href="#">通信</a></li><li><a href="#">手机</a><a href="#">数码</a><a href="#">通信</a></li><li><a href="#">手机</a><a href="#">数码</a><a href="#">通信</a></li></ul></div></div><div class="navitems"><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></div></div></nav><!-- nav导航部分 end --><!-- 首页专有模块 --><!-- main模块  start --><div class="w"><div class="main"><div class="focus"><ul><li><img src="upload/focus1.png" alt=""></li></ul><!-- 左侧按钮 --><a href="#" class="prev">&lt;</a><!-- 右侧按钮 --><a href="#" class="next">&gt;</a><!-- 底部小圆点 --><ul class="promo_nav"><li class="selected"></li><li></li><li></li><li></li><li></li></ul></div><div class="newsflash"><div class="news"><div class="news-hd"><h5>品优购快报</h5><a href="#" class="more">更多</a></div><div class="news-bd"><ul><li><a href="#"><strong>[重磅]</strong> 它来了它来了,带着财宝走来了</a></li><li><a href="#"><strong>[重磅]</strong> 它来了它来了,带着财宝走来了</a></li><li><a href="#"><strong>[重磅]</strong> 它来了它来了,带着财宝走来了</a></li><li><a href="#"><strong>[重磅]</strong> 它来了它来了,带着财宝走来了</a></li><li><a href="#"><strong>[重磅]</strong> 它来了它来了,带着财宝走来了,lailailalallalall</a></li></ul></div></div><div class="lifeservice"><ul><li><i></i><p>话费</p></li><li><i></i><p>话费</p></li><li><i></i><p>话费</p></li><li><i></i><p>话费</p></li><li><i></i><p>话费</p></li><li><i></i><p>话费</p></li><li><i></i><p>话费</p></li><li><i></i><p>话费</p></li><li><i></i><p>话费</p></li><li><i></i><p>话费</p></li><li><i></i><p>话费</p></li><li><i></i><p>话费</p></li></ul></div><div class="bargin"><img src="upload/bargin.png" alt=""></div></div></div></div><!-- main模块  end --><!-- 推荐模块 start --><div class="w recom"><div class="recom-hd"><img src="images/recom.png" alt=""></div><div class="recom-bd"><ul><li><img src="upload/recom_03.png" alt=""></li><li><img src="upload/recom_03.png" alt=""></li><li><img src="upload/recom_03.png" alt=""></li><li><img src="upload/recom_03.png" alt=""></li></ul></div></div><!-- 推荐模块 end --><!-- 猜你喜欢模块 start --><div class="w"><div class="fav-hd"><h5>猜你喜欢</h5><p>换一批</p></div><div class="fav-bd"><ul><li><a href="#"><div><img src="upload/fav1.png" alt=""></div><p>阳光美包新款单肩包女<br>包时尚子母包四件套女</p><p class="price">¥116.00</p></a></li><li><a href="#"><div><img src="upload/fav2.png" alt=""></div><p>阳光美包新款单肩包女<br>包时尚子母包四件套女</p><p class="price">¥116.00</p></a></li><li><a href="#"><div><img src="upload/fav3.png" alt=""></div><p>阳光美包新款单肩包女<br>包时尚子母包四件套女</p><p class="price">¥116.00</p></a></li><li><a href="#"><div><img src="upload/fav4.png" alt=""></div><p>阳光美包新款单肩包女<br>包时尚子母包四件套女</p><p class="price">¥116.00</p></a></li><li><a href="#"><div><img src="upload/fav5.png" alt=""></div><p>阳光美包新款单肩包女<br>包时尚子母包四件套女</p><p class="price">¥116.00</p></a></li><li><a href="#"><div><img src="upload/fav6.png" alt=""></div><p>阳光美包新款单肩包女<br>包时尚子母包四件套女</p><p class="price">¥116.00</p></a></li></ul></div></div><!-- 猜你喜欢模块 end --><!-- 楼层区域模块 start --><div class="floor"><!-- 1楼家用电器楼层 --><div class="w jiadian"><div class="box-hd"><h3>家用电器</h3><div class="tab_list"><ul><li><a href="#" class="style_red">热门</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><li><a href="#">高端电器</a></li></ul></div></div><div class="box-bd"><div class="tab_content"><div class="tab_list_item"><div class="col_210"><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><a href="#"><img src="upload/floor-1-1.png" alt=""></a></div><div class="col_329"><a href="#"><img src="upload/floor-1-b01.png" alt=""></a></div><div class="col_221"><a href="#" class="bb"><img src="upload/floor-1-2.png" alt=""></a><a href="#"><img src="upload/floor-1-3.png" alt=""></a></div><div class="col_221"><a href="#"><img src="upload/floor-1-4.png" alt=""></a></div><div class="col_219"><a href="#" class="bb"><img src="upload/floor-1-5.png" alt=""></a><a href="#"><img src="upload/floor-1-6.png" alt=""></a></div></div></div></div></div><!-- 2楼手机楼层 --><div class="w shouji"><div class="box-hd"><h3>手机</h3><div class="tab_list"><ul><li><a href="#" class="style_red">热门</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><li><a href="#">高端电器</a></li></ul></div></div><div class="box-bd"><div class="tab_content"><div class="tab_list_item"><div class="col_210"><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><a href="#"><img src="upload/floor-1-1.png" alt=""></a></div><div class="col_329"><a href="#"><img src="upload/floor-1-b01.png" alt=""></a></div><div class="col_221"><a href="#" class="bb"><img src="upload/floor-1-2.png" alt=""></a><a href="#"><img src="upload/floor-1-3.png" alt=""></a></div><div class="col_221"><a href="#"><img src="upload/floor-1-4.png" alt=""></a></div><div class="col_219"><a href="#" class="bb"><img src="upload/floor-1-5.png" alt=""></a><a href="#"><img src="upload/floor-1-6.png" alt=""></a></div></div></div></div></div></div><!-- 楼层区域模块 end --><!-- 底部模块 start--><footer class="footer"><div class="w"><div class="mod_service"><ul><li><h5></h5><div class="service_text"><h4>正品保障</h4><p>正品保障,提供发票</p></div></li><li><h5></h5><div class="service_text"><h4>正品保障</h4><p>正品保障,提供发票</p></div></li><li><h5></h5><div class="service_text"><h4>正品保障</h4><p>正品保障,提供发票</p></div></li><li><h5></h5><div class="service_text"><h4>正品保障</h4><p>正品保障,提供发票</p></div></li></ul></div><div class="mod_help"><dl><dt>服务指南</dt><dd><a href="#">购物流程</a></dd><dd><a href="#">会员介绍</a></dd><dd><a href="#">生活旅行/团购</a></dd><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><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><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><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><dd><a href="#">常见问题</a></dd><dd><a href="#">大家电</a></dd><dd><a href="#">联系客服</a></dd></dl><dl><dt>帮助中心</dt><dd><img src="images/wx_cz.jpg" alt="">品优购客户端</dd></dl></div><div class="mod_copyright"><div class="links"><a href="#">关于我们</a>|<a href="#">联系我们</a>|<a href="#">联系客服</a>|<a href="#">商家入驻</a>|<ahref="#">营销中心</a>|<a href="#">手机品优购</a>|<a href="#">友情链接</a>|<a href="#">销售联盟</a>|<ahref="#">品优购社区</a>|<a href="#">品优购公益</a>|<a href="#">English Site</a>|<a href="#">ontact U</a>C</div><div class="copyright">地址:广东省广州市海珠区昌盛里12345678号一楼 邮编:510240 传真:010-789956378 邮箱:23432468264@qq.com <br>京ICP备9787687364号京公网安备27645356472</div></div></div></footer><!-- 底部模块 end-->
</body></html>

index.css

.main {width: 980px;height: 455px;margin-left: 220px;margin-top: 10px;
}
.focus {position: relative;float: left;width: 721px;height: 455px;
}
.focus ul li img {width: 721px;height: 455px;
}
.prev,
.next {position: absolute;top: 50%;width: 30px;height: 30px;background: rgba(0, 0, 0, .3);line-height: 30px;text-align: center;color: #fff;
}
.prev {left: 0;border-top-right-radius: 15px;border-bottom-right-radius: 15px;
}
.next {right: 0;border-top-left-radius: 15px;border-bottom-left-radius: 15px;
}
.promo_nav {position: absolute;left: 50%;margin-left: -35px;bottom: 15px;width: 70px;height: 13px;background-color: rgba(255,255,255,.3);border-radius: 7px;
}
.promo_nav li {float: left;width: 8px;height: 8px;background-color: #fff;border-radius: 50%;margin: 3px;
}
.promo_nav .selected {background-color: #ff5000;
}
.newsflash {float: right;width: 250px;height: 455px;
}
.news {height: 165px;border: 1px solid #e4e4e4;
}
.lifeservice {overflow: hidden;height: 209px;border: 1px solid #e4e4e4;border-top: 0;}
.bargin {margin-top: 5px;
}
.news-hd {height: 33px;line-height: 33px;border-bottom: 1px dotted #e4e4e4;padding: 0 15px;
}
.news-hd h5 {float: left;font-size: 14px;
}
.news-hd .more {float: right;
}
.news-hd .more::after {content: '\e920';font-family: 'icomoon';
}
.news-bd {padding: 5px 15px 0;
}
.news-bd li {height: 24px;line-height: 24px;/* 文字溢出用省略号显示 */overflow: hidden;white-space: nowrap;text-overflow: ellipsis;
}
.lifeservice ul {width: 252px;
}
.lifeservice ul li {float: left;width: 63px;height: 71px;border-right: 1px solid #e4e4e4;border-bottom: 1px solid #e4e4e4;text-align: center;
}
.lifeservice ul li i {display: inline-block;width: 25px;height: 25px;background-color: pink;margin-top: 12px;background: url(../images/icons.png) no-repeat -16px -16px;
}
/* 推荐模块 */
.recom {height: 163px;margin-top: 12px;background-color: #ebebeb;
}
.recom-hd {float: left;height: 163px;width: 205px;text-align: center;padding-top: 30px;background-color: #5c5251;
}
.recom-bd {float: left;
}
.recom-bd ul li {float: left;position: relative;
}
.recom-bd ul li img {width: 243px;height: 163px;
}
.recom-bd ul li:nth-child(-n+3)::after {content: '';position: absolute;top: 10px;right: 0;width: 1px;height: 145px;background-color: #ddd;
}
/* 猜你喜欢模块 */
.fav-hd {height: 42px;line-height: 42px;margin-top: 18px;
}
.fav-hd h5 {float: left;font-size: 18px;font-weight: 400;
}
.fav-hd p {float: right;
}
.fav-hd p::after {content: '\ea2e';font-family: 'icomoon';margin-left: 10px;margin-right: 20px;
}
.fav-bd {height: 234px;border: 1px solid #ededed;
}
.fav-bd ul {width: 1200px;
}
.fav-bd ul li {position: relative;float: left;width: 200px;height: 234px;
}
.fav-bd ul li:nth-child(-n+5)::after {content: '';position: absolute;bottom: 10px;right: 0;width: 1px;height: 63px;background-color: #ededed;
}
.fav-bd ul li div {width: 200px;height: 162px;display: table-cell;text-align: center;vertical-align: middle;
}
.fav-bd ul li p {margin-left: 34px;margin-top: 2px;font-size: 12px;
}
.fav-bd ul li .price {font-size: 18px;color: #df3033;
}/* 家用电器模块 */
.floor .w {margin-top: 30px;
}
.box-hd {height: 30px;border-bottom: 2px solid #c81623;
}
.box-hd h3 {float: left;font-size: 18px;color: #c81623;font-weight: 400;
}
.tab_list {float: right;line-height: 30px;
}
.tab_list ul li {float: left;
}
.tab_list ul li a {padding: 0 15px;
}
.box-bd {height: 361px;
}
.tab_list_item>div {float: left;height: 361px;
}
.col_210 {width: 210px;background-color: #f9f9f9;text-align: center;
}
.col_210 ul {margin-left: 2px;
}
.col_210 ul li {float: left;width: 85px;height: 34px;border-bottom: 1px solid #ccc;line-height: 33px;text-align: center;margin-left: 10px;
}
.col_329 {width: 329px;
}
.col_221 {width: 221px;border-right: 1px solid #ccc;
}
.col_219 {width: 219px;
}
.bb {/* 一般情况下,a如果包含有宽度的盒子,a需要转换为块级元素 */display: block;border-bottom: 1px solid #ccc;
}

list.html

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>列表页-正品低价、品质保障、配送及时、轻松购物!</title><!-- 网站说明 --><meta name="description"content="品优购商城-专业的综合网上购物商城,销售家电、数码通讯、电脑、家居百货、服装服饰、母婴、图书、食品等数万个品牌优质商品.便捷、诚信的服务,为您提供愉悦的网上购物体验!" /><!-- 关键字 --><meta name="Keywords" content="网上购物,网上商城,手机,笔记本,电脑,MP3,CD,VCD,DV,相机,数码,配件,手表,存储卡,京东" /><!-- 引入页面favicon图标(网上在线转成ico文件放到根目录下) --><link rel="shortcut icon" href="favicon.ico"><!-- 引入初始化css文件 --><link rel="stylesheet" href="css/base.css"><!-- 引入公共样式文件 --><link rel="stylesheet" href="css/common.css"><!-- 引入list.css文件 --><link rel="stylesheet" href="css/list.css">
</head><body><!-- 快捷导航模块 start--><section class="shortcut"><div class="w"><div class="fl"><ul><li>品优购欢迎您!&nbsp;</li><li><a href="#">请登录</a> &nbsp;<a href="register.html" class="style_red">免费注册</a></li></ul></div><div class="fr"><ul><li>我的订单</li><li></li><li class="arrow_icon">我的品优购</li><li></li><li>品优购会员</li><li></li><li>企业采购</li><li></li><li class="arrow_icon">关注品优购</li><li></li><li class="arrow_icon">客户服务</li><li></li><li class="arrow_icon">网站导航</li></ul></div></div></section><!-- 快捷导航模块 end--><!-- header头部模块制作 start --><header class="header w"><!-- logo模块 --><div class="logo"><h1><a href="index.html" title="品优购商城">品优购商城</a></h1></div><!-- 列表页新增的秒杀图标 --><div class="sk"><img src="images/sk.png" alt=""></div><!-- search模块 --><div class="search"><input type="search" name="" id="" placeholder="语言开发"><button>搜索</button></div><!-- hotwords模块 --><div class="hotwords"><a href="#" class="style_red">优惠购首发</a><a href="#">亿元优惠</a><a href="#">9.9元团购</a><a href="#">每满99减30</a><a href="#">办公用品</a><a href="#">电脑</a><a href="#">手机</a></div><!-- shopcar模块 --><div class="shopcar">我的购物车<i class="count">8</i></div></header><!-- header头部模块制作 end --><!-- nav导航部分 start --><nav class="nav"><div class="w"><div class="sk_list"><ul><li><a href="#">品优购秒杀</a></li><li><a href="#">品优购秒杀</a></li><li><a href="#">品优购秒杀</a></li></ul></div><div class="sk_con"><ul><li><a href="#">女装</a></li><li><a href="#" class="style_red">女装</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></div></div></nav><!-- nav导航部分 end --><!-- 列表页主体部分 start --><div class="w sk_container"><div class="sk_hd"><img src="upload/bg_03.png" alt=""></div><div class="sk_bd"><!-- li没有高度,li浮动,因此li的父亲ul要清除浮动 --><ul class="clearfix"><li><div><img src="upload/phone.png" alt=""></div><p>Apple苹果iPhone 6s Plus(A1699)32G 金色 移动联通电信4G手机</p><div class="price"><i></i><em class="now">6088</em><em class="before">¥6988</em></div><div class="selling">已售87%<div class="bar"><div class="bar_in"></div></div>剩余<i>29</i></div><button>立即抢购</button></li><li><div><img src="upload/phone.png" alt=""></div><p>Apple苹果iPhone 6s Plus(A1699)32G 金色 移动联通电信4G手机</p><div class="price"><i></i><em class="now">6088</em><em class="before">¥6988</em></div><div class="selling">已售87%<div class="bar"><div class="bar_in"></div></div>剩余<i>29</i></div><button>立即抢购</button></li><li><div><img src="upload/phone.png" alt=""></div><p>Apple苹果iPhone 6s Plus(A1699)32G 金色 移动联通电信4G手机</p><div class="price"><i></i><em class="now">6088</em><em class="before">¥6988</em></div><div class="selling">已售87%<div class="bar"><div class="bar_in"></div></div>剩余<i>29</i></div><button>立即抢购</button></li><li><div><img src="upload/phone.png" alt=""></div><p>Apple苹果iPhone 6s Plus(A1699)32G 金色 移动联通电信4G手机</p><div class="price"><i></i><em class="now">6088</em><em class="before">¥6988</em></div><div class="selling">已售87%<div class="bar"><div class="bar_in"></div></div>剩余<i>29</i></div><button>立即抢购</button></li><li><div><img src="upload/phone.png" alt=""></div><p>Apple苹果iPhone 6s Plus(A1699)32G 金色 移动联通电信4G手机</p><div class="price"><i></i><em class="now">6088</em><em class="before">¥6988</em></div><div class="selling">已售87%<div class="bar"><div class="bar_in"></div></div>剩余<i>29</i></div><button>立即抢购</button></li><li><div><img src="upload/phone.png" alt=""></div><p>Apple苹果iPhone 6s Plus(A1699)32G 金色 移动联通电信4G手机</p><div class="price"><i></i><em class="now">6088</em><em class="before">¥6988</em></div><div class="selling">已售87%<div class="bar"><div class="bar_in"></div></div>剩余<i>29</i></div><button>立即抢购</button></li><li><div><img src="upload/phone.png" alt=""></div><p>Apple苹果iPhone 6s Plus(A1699)32G 金色 移动联通电信4G手机</p><div class="price"><i></i><em class="now">6088</em><em class="before">¥6988</em></div><div class="selling">已售87%<div class="bar"><div class="bar_in"></div></div>剩余<i>29</i></div><button>立即抢购</button></li><li><div><img src="upload/phone.png" alt=""></div><p>Apple苹果iPhone 6s Plus(A1699)32G 金色 移动联通电信4G手机</p><div class="price"><i></i><em class="now">6088</em><em class="before">¥6988</em></div><div class="selling">已售87%<div class="bar"><div class="bar_in"></div></div>剩余<i>29</i></div><button>立即抢购</button></li><li><div><img src="upload/phone.png" alt=""></div><p>Apple苹果iPhone 6s Plus(A1699)32G 金色 移动联通电信4G手机</p><div class="price"><i></i><em class="now">6088</em><em class="before">¥6988</em></div><div class="selling">已售87%<div class="bar"><div class="bar_in"></div></div>剩余<i>29</i></div><button>立即抢购</button></li></ul></div></div><!-- 列表页主体部分 end --><!-- 底部模块 start--><footer class="footer"><div class="w"><div class="mod_service"><ul><li><h5></h5><div class="service_text"><h4>正品保障</h4><p>正品保障,提供发票</p></div></li><li><h5></h5><div class="service_text"><h4>正品保障</h4><p>正品保障,提供发票</p></div></li><li><h5></h5><div class="service_text"><h4>正品保障</h4><p>正品保障,提供发票</p></div></li><li><h5></h5><div class="service_text"><h4>正品保障</h4><p>正品保障,提供发票</p></div></li></ul></div><div class="mod_help"><dl><dt>服务指南</dt><dd><a href="#">购物流程</a></dd><dd><a href="#">会员介绍</a></dd><dd><a href="#">生活旅行/团购</a></dd><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><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><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><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><dd><a href="#">常见问题</a></dd><dd><a href="#">大家电</a></dd><dd><a href="#">联系客服</a></dd></dl><dl><dt>帮助中心</dt><dd><img src="images/wx_cz.jpg" alt="">品优购客户端</dd></dl></div><div class="mod_copyright"><div class="links"><a href="#">关于我们</a>|<a href="#">联系我们</a>|<a href="#">联系客服</a>|<a href="#">商家入驻</a>|<ahref="#">营销中心</a>|<a href="#">手机品优购</a>|<a href="#">友情链接</a>|<a href="#">销售联盟</a>|<ahref="#">品优购社区</a>|<a href="#">品优购公益</a>|<a href="#">English Site</a>|<a href="#">ontact U</a>C</div><div class="copyright">地址:广东省广州市海珠区昌盛里12345678号一楼 邮编:510240 传真:010-789956378 邮箱:23432468264@qq.com <br>京ICP备9787687364号京公网安备27645356472</div></div></div></footer><!-- 底部模块 end-->
</body></html>

list.css

/* 列表页css文件 */
.nav {overflow: hidden;
}
/* header新增的秒杀图标 */
.sk {position: absolute;left: 190px;top: 40px;border-left: 1px solid #c81523;padding: 3px 0 0 14px;
}
.sk_list {float: left;
}
.sk_list ul li {float: left;
}
.sk_list ul li a {display: block;line-height: 47px;padding: 0 30px;font-size: 16px;font-weight: 700;color: #000;
}
.sk_con {float: left;
}
.sk_con ul li {float: left;
}
.sk_con ul li a {display: block;line-height: 49px;padding: 0 20px;font-size: 14px;
}
.sk_con ul li:last-child a::after {content: '\e91e';font-family: 'icomoon';
}
.sk_bd ul li {overflow: hidden;float: left;width: 290px;height: 460px;margin-right: 13px;border: 1px solid transparent;
}
.sk_bd ul li:nth-child(4n) {margin-right: 0;
}
.sk_bd ul li:hover {border: 1px solid #c81523;
}
.sk_bd ul li img {width: 290px;height: 299px;
}
.sk_bd ul li p {margin-left: 14px;margin-right: 10px;font-size: 14px;
}
.sk_bd ul li .price {height: 40px;line-height: 50px;padding-left: 16px;
}
.sk_bd ul li i{color: #e60012;font-size: 14px;
}
.sk_bd ul li .now {color: #e60012;font-size: 22px;font-weight: 700;
}
.sk_bd ul li .before {font-size: 14px;margin-left: 8px;text-decoration: line-through;
}
.sk_bd ul li .selling {height: 14px;padding-left: 15px;
}
.sk_bd ul li .selling .bar {display: inline-block;width: 132px;height: 14px;border: 1px solid #ed282e;border-radius: 5px;margin: 0 12px;
}
.sk_bd ul li .selling .bar_in {width: 87%;height: 100%;background-color: #ed282e;
}
.sk_bd ul li .selling i {color: #e12228;font-size: 16px;
}
.sk_bd ul li button {width: 290px;height: 50px;font-size: 20px;color: #fff;background-color: #b1191a;margin-top: 15px;
}

register.html

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>个人注册</title><!-- 引入页面favicon图标(网上在线转成ico文件放到根目录下) --><link rel="shortcut icon" href="favicon.ico"><!-- 引入初始化css文件 --><link rel="stylesheet" href="css/base.css"><!-- 引入register.css文件 --><link rel="stylesheet" href="css/register.css">
</head><body><div class="w"><header><div class="logo"><a href="index.html"><img src="images/logo.png" alt=""></a></div></header><div class="registerarea"><h3>注册新用户<div class="login">我有账号,去<a href="#">登陆</a></div></h3><div class="reg_form"><form action=""><ul><li><label for="">手机号:</label><input type="text" name="" id="" class="inp"><span class="error"> <i class="error_icon"></i>手机号码格式不正确,请重新输入</span></li><li><label for="">短信验证码:</label><input type="text" name="" id="" class="inp"><span class="success"> <i class="success_icon"></i>短信验证码输入正确</span></li><li><label for="">登陆密码:</label><input type="password" name="" id="" class="inp"><span class="error"> <i class="error_icon"></i>手机号码格式不正确,请重新输入</span></li><li class="safe">安全程度 <em class="ruo"></em><em class="zhong"></em><em class="qiang"></em></li><li><label for="">确认密码:</label><input type="password" name="" id="" class="inp"><span class="error"> <i class="error_icon"></i>手机号码格式不正确,请重新输入</span></li><li class="agree"><input type="checkbox" name="" id="">同意协议并注册<a href="#">《知晓用户协议》</a></li><li><input type="submit" value="完成注册" class="btn"></li></ul></form></div></div><footer><div class="mod_copyright"><div class="links"><a href="#">关于我们</a>|<a href="#">联系我们</a>|<a href="#">联系客服</a>|<a href="#">商家入驻</a>|<ahref="#">营销中心</a>|<a href="#">手机品优购</a>|<a href="#">友情链接</a>|<a href="#">销售联盟</a>|<ahref="#">品优购社区</a>|<a href="#">品优购公益</a>|<a href="#">English Site</a>|<a href="#">ontact U</a>C</div><div class="copyright">地址:广东省广州市海珠区昌盛里12345678号一楼 邮编:510240 传真:010-789956378 邮箱:23432468264@qq.com <br>京ICP备9787687364号京公网安备27645356472</div></div></footer></div>
</body></html>

register.css

.w {width: 1200px;margin: 0 auto;
}
header {height: 84px;border-bottom: 2px solid #c81523;
}
.logo {padding-top: 18px;
}
.registerarea {height: 522px;border: 1px solid #ccc;margin-top: 20px;
}
.registerarea h3 {height: 42px;border-bottom: 1px solid #ccc;background-color: #ececec;line-height: 42px;padding: 0 10px;font-size: 18px;font-weight: 400;
}
.login {float: right;font-size: 14px;
}
.login a {color: #c81523;
}
.reg_form {width: 600px;margin: 50px auto 0;
}
.reg_form ul li {margin-bottom: 20px;
}
.reg_form ul li label {display: inline-block;width: 88px;text-align: right;
}
.reg_form ul li .inp {width: 242px;height: 37px;border: 1px solid #ccc;
}
.error {color: #c81523;
}
.error_icon {display: inline-block;vertical-align: middle;width: 20px;height: 20px;background: url(../images/error.png) no-repeat;margin-top: -3px;margin-right: 3px;
}
.success {color: green;
}
.success_icon {display: inline-block;vertical-align: middle;width: 20px;height: 20px;background: url(../images/error.png) no-repeat;margin-top: -3px;margin-right: 3px;
}
.safe {padding-left: 170px;
}
.safe em {padding: 0 12px;color: #fff;
}
.ruo {background-color: #de1111;
}
.zhong {background-color: #40b83f;
}
.qiang {background-color: #f79100;
}
.agree {padding-left: 95px;
}
.agree input{vertical-align: middle;margin-right: 5px;
}
.agree a {color: #1ba1e6;
}
.btn {width: 200px;height: 34px;background-color: #c81623;font-size: 14px;color: #fff;margin:30px 0 0 110px;
}
/* 底部 */
.mod_copyright {text-align: center;padding-top: 20px;
}
.links {margin-bottom: 15px;
}
.links a {margin: 0 3px;
}
.copyrights {line-height: 20px;
}

前端——品优购项目(html+css)相关推荐

  1. 品优购项目html+css+js

    品优购项目html+css+js 跟着pink老师学前端,第一个完成的项目,总共有三个页面,分别是index.html.list.html和detail.html,下面是该项目的一些总结,最后有源码呦 ...

  2. web前端入门学习 css(9)广义的html5 品优购项目(html+css基础完结,js开始,移动端布局开始)

    文章目录 广义的html5 品优购项目导读 网站制作流程 原型图 项目规划 项目整体介绍 项目规划 项目搭建 网站favicon图标 网站TDK三大标签SEO优化 品优购首页制作 常用模块类名命名 快 ...

  3. Web前端开发——品优购项目(上)

    品优购项目介绍 项目名称:品优购 项目描述:品优购是一个电商网站,我们要完成 PC 端首页.列表页.注册页面的制作 主页 列表页 注册页 品优购项目的学习目的 电商类网站比较综合,里面需要大量的布局技 ...

  4. b站pink老师前端课程、品优购项目(跟着练的笔记+代码)

    02.网站制作流程 1. 03.品优购项目规划 04.项目搭建 05.样式的模块化开发 06.favicon图标制作 favicon.ico一般用于作为略缩图的网站标志,它显示在浏览器的地址栏或者标签 ...

  5. CSS 8 品优购项目

    目录 1.品优购项目规划 1.1网站制作流程 1.2品优购项目整体介绍 1.3品优购项目的学习目的 1.4开发工具以及技术栈 小总结​ 1.5品优购项目搭建工作. 1.5.1创建文件夹 1.5.2创建 ...

  6. css三角形之美与品优购项目

    CSS三角形之美 div{width: 0;height: 0;line-height:0;font-size: 0;border-top: 10px solid red;border-right:1 ...

  7. HTML+CSS+JavaScript实现的品优购项目源代码,包含首页、登录页面、注册页面、商品秒杀页、商品推文页、商品抢购页等

    本次项目一共实现了7个界面,包括首页.登录页面.注册页面.商品秒杀页.商品推文页.商品抢购页.商品详情页等界面. 完整代码下载地址:HTML+CSS+JavaScript实现的品优购项目源代码 项目展 ...

  8. 14.------------------------------------------------------------------------------【PC端品优购项目】

    文章目录 [PC端品优购项目]前端小抄(14) 电商-主页 电商-分类列表页 电商-注册页 一.品优购项目规划 1.1 网站制作流程 1.2 品优购项目整体介绍 1.3 品优购项目的学习目的 1.4 ...

  9. 品优购项目——黑马程序员pink老师/完整源代码/项目讲解/内容补充完善

    话不多说先看效果图,源代码在文末 首页 产品页:根据此前京东抢购案例补充完善 注册页 文章目录 品优购项目规划 1. 网站制作流程 2. 品优购项目整体介绍 3. 开发工具以及技术栈 4. 品优购项目 ...

最新文章

  1. mos管开关电路_MOS管的知识,看这一篇就可以了
  2. [转]html超链接打开的窗口大小
  3. 深入解读 Knative Eventing 0.7 版本新特性
  4. FCPX插件:半调图像高级马赛克特效Yanobox Mosaic
  5. 雷军:小米10是首款支持8x8 MU-MIMO的手机
  6. 大数据技术在各行业中的挑战有哪些
  7. python opencv 识别角度_opencv python 角点检测/FAST算法
  8. 计算机打印服务总是自动关闭,XP系统Print spooler总是自动关闭的解决方法
  9. 微信公众号支付失败的各种原因
  10. PhotoScissors 6 for Mac(mac抠图软件)
  11. React-native学习-59:使用react-native-vector-icons图标库
  12. ubuntu phpmyadmin php5.3,ubuntu中怎么下载安装phpmyadmin
  13. 循环卷积和线性卷积的关系
  14. 详述Android马甲包
  15. 00、老徐教你学C语言——C语言学习之道(学习篇)——理论
  16. .net 网站接入支付宝扫码支付
  17. Android实例-手机安全卫士(四十一)-选择自定义Toast背景
  18. 微信小程序表白墙管理系统带后端带说明
  19. .net的web开发前后端传值系列(二)
  20. 32位程序和64位程序

热门文章

  1. 0x00000050电脑蓝屏怎么解决
  2. Linux ubuntu20.04 root密钥登录教程(图文教程)
  3. vue项目中使用三角形怎么办
  4. 寻址数字基带以解锁 6G 的太赫兹通信
  5. 【蓝桥杯 算法训练】强力党逗志芃
  6. 学生档案c语言编程,学生档案管理完整(C语言).doc
  7. Python数组list操作
  8. 2021年安全员-C证(山东省)考试技巧及安全员-C证(山东省)考试平台
  9. sql server 获取字符串长度
  10. python数据分析与爬虫区别_Python数据分析和爬虫的书分享