[关闭]
@wangzhuanyun 2017-06-30T01:42:09.000000Z 字数 3356 阅读 649

鸿卓商城——首页

作者:王转运

鸿卓国际


1.实现底部菜单

QQ截图20170629144433.png-22.2kB
写入HTML代码如下:

  1. .nav{
  2. background-color: #fff; /*设置颜色为白色
  3. z-index: 100; /*可用于将在一个元素放置于另一元素之后*/
  4. position: fixed;/*将元素固定在某个位置上 相对于浏览器窗口进行定位*/
  5. width: 100%;
  6. bottom: 0;/*设置底部边距为0*/
  7. left: 0px/*设置左边边距为0*/
  8. }
  9. .nav ul {
  10. height: 0px;
  11. }
  12. .nav ul li{
  13. list-style: none;/*去掉黑点*/
  14. float: left; /*元素向左浮动靠拢*/
  15. width: 25%;
  16. text-align: center; /*元素内容居中*/
  17. padding: 0px;/*内边距0*/
  18. margin: 0px/*外边距0*/
  19. }
  20. .nav ul li span{
  21. font-size: 12px;/*字体大小为12P*/
  22. line-height: 20px;/*行高*/
  23. display: block;/*将元素变为块级元素 */
  24. }
  25. * {
  26. padding: 0;
  27. margin: 0;
  28. }
  29.  
  30.  
  31. <div class="nav">
  32. <ul>
  33. <li>
  34. <img alt="" src="img/bottom1_1.png" height="35">
  35. <span>首页</span>
  36. </li>
  37. <li>
  38. <img alt="" src="img/bottom2.png" height="35">
  39. <span>鸿卓分类</span>
  40. </li>
  41. <li>
  42. <img alt="" src="img/bottom3.png" height="35">
  43. <span>购物车</span>
  44. </li>
  45. <li>
  46. <img alt="" src="img/bottom4.png" height="35">
  47. <span>我的</span>
  48. </li>
  49. </ul>
  50. </div>
  51.  
  52.  
  53.  

2.引入轮播图插件

引入相应的JS与CSS后 写入HTML代码如下:

  1. <link href="css/lunbo.css" rel="stylesheet" type="text/css"/>
  2.  
  3. <div class="WSCSlideWrapper">
  4. < div class="WSCSlide WSCSlideTransition">
  5. <img class="WSCSlide_img" src="img/banners.png" style="max-width: 100%;" />
  6. <img class="WSCSlide_img" src="img/banners.png" style="max-width: 100%;"/>
  7. <img class="WSCSlide_img" src="img/banners.png" style="max-width: 100%;" />
  8. </div>
  9. <div class="WSCSlideStatus">
  10. </div>
  11.  
  12. #代码说明:
  13. max-width: 100% 设置图片最大宽度为100%
  14.  
  15. <script type="text/javascript" src="js/jquery.js"></script>
  16. <script type="text/javascript" src="js/lunbo.js"></script>
  17.  
  18. #代码说明:
  19. 以上两行JS 请放到<body>标签后

3.首页账户余额与最近购买

image_1bjp9revghq21nhhe8l1i4k1vdp1l.png-12.3kB
写入HTML代码如下:

  1. <div class="col-xs-10 col-xs-offset-1" style="box-shadow:0px 10px 25px -10px #A8A8A8;padding: 10px;;background-color: #fff;margin-top:5px">
  2. <div class="col-xs-5 text-center" style="color:#686868">
  3. <div style="width: 100%">账户余额</div>
  4. <span style="color:#00B8F1" >100元</span>
  5. </div>
  6. <div class="col-xs-2 text-center" style="color:#686868">
  7. <div style=" background-color: #888;height: 40px; width: 1px;"></div>
  8. </div>
  9. <div class="col-xs-5 text-center" style="color:#686868">
  10. <div style="width: 100%">最近购买</div>
  11. <span style="color:#00B8F1" >3</span>
  12. </div>
  13. </div>
  14.  
  15. #代码说明:
  16. col-xs-* 列宽,最大值为12 xs为超小屏幕 手机 (<768px)
  17. col-xs-offset-* 列偏移,可以让元素向右移
  18. box-shadow:上 右 下 左 颜色 设置边框发光
  19. background-color 设置背景颜色
  20. text-center 元素下文本居中
  21. color 设置字体颜色
  22.  

4.首页商品类型

image_1bjpado4vki110ud1hlm14741k522f.png-24.4kB
写入HTML代码如下:

  1. <div class="col-xs-12" >
  2. <div class="col-xs-6 text-center" style="margin-top: 10px">
  3. //电脑精选
  4. <img alt="" src="img/computer.png" style="max-width: 100%">
  5. </div>
  6. <div class="col-xs-6 text-center" style="margin-top: 10px">
  7. //手机精选
  8. <img alt="" src="img/telephone.png" style="max-width: 100%">
  9. </div>
  10. <div class="col-xs-6 text-center" style="margin-top: 10px">
  11. //耳机精选
  12. <img alt="" src="img/headset.png" style="max-width: 100%">
  13. </div>
  14. <div class="col-xs-6 text-center" style="margin-top: 10px">
  15. //其他配件
  16. <img alt="" src="img/other.png" style="max-width: 100%">
  17. </div>
  18. </div>

5.首页今日推荐

image_1bjpar9gupjl894cd7jqet9d2s.png-4.1kB
写入HTML代码如下:

  1. <table class="table" style="margin-bottom: 50px;">
  2. <tr >
  3. <td style="width: 22px;padding:5px 0px">
  4. <img alt="" src="img/dian.png" width="20px">
  5. </td>
  6. <td style="width: 72px;padding:5px 0px">今日推荐</td>
  7. <td>
  8. <div style=" background-color: #D5D5D5;height: 1px; width: 100%;;margin-top:10px"></div>
  9. </td>
  10. </tr>
  11.  
  12. </table>
  13. #代码说明:
  14. <table> 表格(有行和列组成)
  15. <tr > 表格行
  16. <td> 表格列
  17. class="table" 为Bootstrap框架自带表格样式

6.商品信息展示

image_1bjpar9gupjl894cd7jqet9d2s.png-4.1kB
写入HTML代码如下:

  1. <div class="col-xs-12 " style="margin-bottom: 15px" >
  2.  
  3. <div class="col-xs-6 " style="padding: 0px;margin-bottom: 10px">
  4.  
  5. <img alt="" src="img/Label.png" style="position: absolute;max-width:35%">
  6. <div style="background-color: #fff;margin: 5px;padding:10px">
  7. <img alt="" src="img/图片名称" style="max-width: 100%">
  8.  
  9. </div>
  10. <div style="font-size: 12px">商品名称</div>
  11. <div style="color:#00B8F1">1000元起</div>
  12. </div>
  13. </div>
  14. #代码说明:
  15. position: absolute 定位 相对于父元素定位
  16.  
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注