小言_互联网的博客

html-css练习题(天天生鲜静态网页制作)文末有完整版代码地址链接

417人阅读  评论(0)

一、前言

前端学习经典练手网页,重新整理网页版代码,如果你是初学者,请试着做一下这个网页

素材:文末完整版代码中。。。。。。

   

二、效果图:

 

 

三、主要需求:


  
  1. 1. login最外侧盒子设定高29 背景颜色#f7f7f7 下边框1
  2. 1.1  login内容部分设置  高20 宽1200 居中
  3. 1.11 左侧欢迎栏设置居中注意浮动
  4. 1.12 右侧我的订单设置宽290 高29 居中注意浮动
  5. 1.12 登录与未登录设置隐藏  注意浮动
  6. 1.121 已经登录设置 a颜色orange 
  7. 1.122 未登录设置 span左右间距 a 鼠标点击变颜色;
  8. 2. search部分设置宽默认高90
  9. 内部内容盒子设置宽1200 高90 居中背景颜色主要测试用
  10. 2.1 左侧logo设置位置上29 左17
  11. 2.2 搜索框设置宽616 高38 边框位置左120 上36 浮动
  12. 搜索框搜索栏设置宽516 高38 居中背景图  缩进40
  13. 搜索框搜索按钮设置宽100 高39 背景颜色字白 14 行高38居中浮动
  14.  
  15. 2.3 右侧购物车宽200 高40 右浮动位置上36
  16. 设置a 宽158 高38 居中背景图字14颜色缩进56
  17. 设置span 宽40 高40 背景颜色字18 白居中
  18. 3 .全部商品分类最外侧高40 上26 边框2 #37ab40
  19.   内容设置宽1200 高40 居中
  20.  
  21. 3.1 全部商品分类宽200高40  居中字14 白背景色浮动
  22.    设置浮动主要是给首页list找边界
  23. 3.2 首页设置宽215高40 左35 上下居中
  24. 设置li 字14 横排一行浮动
  25.   span a 标签设置左右20 字体颜色
  26. 4. slide 高270  内容宽1200高270 居中
  27.  
  28. 4.1 左侧水果列表设置宽200高270 有问题找浮动
  29.   水果列表宽198 高44 边框居中背景图
  30.   雪碧图位置设置采用 nth选择器
  31.   a 字14 背景图有问题找浮动 yo
  32.  
  33. 4.2 轮播图设置宽760 高279 有问题找浮动
  34. 4.21 轮播图宽760*4 高270  有问题找浮动
  35. 4.22 左右按钮宽25高25 背景图定位
  36. 4.23 小圆点设置
  37. 4.3 右侧广告消除行间距设置父元素为0
  38. 5. foods 设置外高335 上25 内宽1200高335 居中
  39. 5.1 上面文字
  40. a 海鲜水产   16px   margin-right:20px;
  41. li标签高29 左10 更多设置高20
  42.  
  43. 5.2 左侧广告宽200 高300 有问题找浮动
  44.  
  45. 5.3 右侧列表产品  宽1000 高300
  46.   列表设置宽249 高299 边框下右居中
  47.   基围虾设置字14 高50 下10
  48. 39.9 元设置字20  红加粗高35 上17

 

四、Html代码赏析:

html文件:


  
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  5. <title>天天生鲜-首页 </title>
  6. <link rel="stylesheet" type="text/css" href="css/reset.css">
  7. <link rel="stylesheet" type="text/css" href="css/main.css">
  8. <script type="text/javascript" src="js/jquery-1.12.4.min.js"> </script>
  9. <script type="text/javascript" src="js/jquery-ui.min.js"> </script>
  10. <script type="text/javascript" src="js/slide.js"> </script>
  11. </head>
  12. <body>
  13. <div class="header_con">
  14. <div class="header">
  15. <div class="welcome fl">欢迎来到天天生鲜! </div>
  16. <div class="fr">
  17. <div class="login_info fl">
  18. 欢迎您: <em>张 山 </em>
  19. </div>
  20. <div class="login_btn fl">
  21. <a href="../templates/login.html">登录 </a>
  22. <span>| </span>
  23. <a href="../templates/register.html">注册 </a>
  24. </div>
  25. <div class="user_link fl">
  26. <span>| </span>
  27. <a href="user_center_info.html">用户中心 </a>
  28. <span>| </span>
  29. <a href="cart.html">我的购物车 </a>
  30. <span>| </span>
  31. <a href="user_center_order.html">我的订单 </a>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="search_bar clearfix">
  37. <a href="index.html" class="logo fl"> <img src="images/logo.png"> </a>
  38. <div class="search_con fl">
  39. <input type="text" class="input_text fl" name="" placeholder="搜索商品">
  40. <input type="button" class="input_btn fr" name="" value="搜索">
  41. </div>
  42. <div class="guest_cart fr">
  43. <a href="#" class="cart_name fl">我的购物车 </a>
  44. <div class="goods_count fl" id="show_count">1 </div>
  45. </div>
  46. </div>
  47. <div class="navbar_con">
  48. <div class="navbar">
  49. <h1 class="fl">全部商品分类 </h1>
  50. <ul class="navlist fl">
  51. <li> <a href="">首页 </a> </li>
  52. <li class="interval">| </li>
  53. <li> <a href="">手机生鲜 </a> </li>
  54. <li class="interval">| </li>
  55. <li> <a href="">抽奖 </a> </li>
  56. </ul>
  57. </div>
  58. </div>
  59. <div class="center_con clearfix">
  60. <ul class="subnav fl">
  61. <li> <a href="#model01" class="fruit">新鲜水果 </a> </li>
  62. <li> <a href="#model02" class="seafood">海鲜水产 </a> </li>
  63. <li> <a href="#model03" class="meet">猪牛羊肉 </a> </li>
  64. <li> <a href="#model04" class="egg">禽类蛋品 </a> </li>
  65. <li> <a href="#model05" class="vegetables">新鲜蔬菜 </a> </li>
  66. <li> <a href="#model06" class="ice">速冻食品 </a> </li>
  67. </ul>
  68. <div class="slide fl">
  69. <ul class="slide_pics">
  70. <li> <img src="images/slide.jpg" alt="幻灯片"> </li>
  71. <li> <img src="images/slide02.jpg" alt="幻灯片"> </li>
  72. <li> <img src="images/slide03.jpg" alt="幻灯片"> </li>
  73. <li> <img src="images/slide04.jpg" alt="幻灯片"> </li>
  74. </ul>
  75. <div class="prev"> </div>
  76. <div class="next"> </div>
  77. <ul class="points"> </ul>
  78. </div>
  79. <div class="adv fl">
  80. <a href="#"> <img src="images/adv01.jpg"> </a>
  81. <a href="#"> <img src="images/adv02.jpg"> </a>
  82. </div>
  83. </div>
  84. <div class="list_model">
  85. <div class="list_title clearfix">
  86. <h3 class="fl" id="model01">新鲜水果 </h3>
  87. <div class="subtitle fl">
  88. <span>| </span>
  89. <a href="#">鲜芒 </a>
  90. <a href="#">加州提子 </a>
  91. <a href="#">亚马逊牛油果 </a>
  92. </div>
  93. <a href="#" class="goods_more fr" id="fruit_more">查看更多 > </a>
  94. </div>
  95. <div class="goods_con clearfix">
  96. <div class="goods_banner fl"> <img src="images/banner01.jpg"> </div>
  97. <ul class="goods_list fl">
  98. <li>
  99. <h4> <a href="#">草莓 </a> </h4>
  100. <a href="#"> <img src="images/goods/goods003.jpg"> </a>
  101. <div class="prize">¥ 30.00 </div>
  102. </li>
  103. <li>
  104. <h4> <a href="#">葡萄 </a> </h4>
  105. <a href="#"> <img src="images/goods/goods002.jpg"> </a>
  106. <div class="prize">¥ 5.50 </div>
  107. </li>
  108. <li>
  109. <h4> <a href="#">柠檬 </a> </h4>
  110. <a href="#"> <img src="images/goods/goods001.jpg"> </a>
  111. <div class="prize">¥ 3.90 </div>
  112. </li>
  113. <li>
  114. <h4> <a href="#">奇异果 </a> </h4>
  115. <a href="#"> <img src="images/goods/goods012.jpg"> </a>
  116. <div class="prize">¥ 25.80 </div>
  117. </li>
  118. </ul>
  119. </div>
  120. </div>
  121. <div class="list_model">
  122. <div class="list_title clearfix">
  123. <h3 class="fl" id="model02">海鲜水产 </h3>
  124. <div class="subtitle fl">
  125. <span>| </span>
  126. <a href="#">河虾 </a>
  127. <a href="#">扇贝 </a>
  128. </div>
  129. <a href="#" class="goods_more fr">查看更多 > </a>
  130. </div>
  131. <div class="goods_con clearfix">
  132. <div class="goods_banner fl"> <img src="images/banner02.jpg"> </div>
  133. <ul class="goods_list fl">
  134. <li>
  135. <h4> <a href="#">青岛野生海捕大青虾 </a> </h4>
  136. <a href="#"> <img src="images/goods/goods018.jpg"> </a>
  137. <div class="prize">¥ 48.00 </div>
  138. </li>
  139. <li>
  140. <h4> <a href="#">扇贝 </a> </h4>
  141. <a href="#"> <img src="images/goods/goods019.jpg"> </a>
  142. <div class="prize">¥ 46.00 </div>
  143. </li>
  144. <li>
  145. <h4> <a href="#">冷冻秋刀鱼 </a> </h4>
  146. <a href="#"> <img src="images/goods/goods020.jpg"> </a>
  147. <div class="prize">¥ 19.00 </div>
  148. </li>
  149. <li>
  150. <h4> <a href="#">基围虾 </a> </h4>
  151. <a href="#"> <img src="images/goods/goods021.jpg"> </a>
  152. <div class="prize">¥ 25.00 </div>
  153. </li>
  154. </ul>
  155. </div>
  156. </div>
  157. <div class="list_model">
  158. <div class="list_title clearfix">
  159. <h3 class="fl" id="model03">猪牛羊肉 </h3>
  160. <div class="subtitle fl">
  161. <span>| </span>
  162. <a href="#">鲜芒 </a>
  163. <a href="#">加州提子 </a>
  164. <a href="#">亚马逊牛油果 </a>
  165. </div>
  166. <a href="#" class="goods_more fr">查看更多 > </a>
  167. </div>
  168. <div class="goods_con clearfix">
  169. <div class="goods_banner fl"> <img src="images/banner03.jpg"> </div>
  170. <ul class="goods_list fl">
  171. <li>
  172. <h4> <a href="#">维多利亚葡萄维多利亚葡萄维多利亚葡萄维多利亚葡萄 </a> </h4>
  173. <a href="#"> <img src="images/goods.jpg"> </a>
  174. <div class="prize">¥ 38.00 </div>
  175. </li>
  176. <li>
  177. <h4> <a href="#">维多利亚葡萄 </a> </h4>
  178. <a href="#"> <img src="images/goods.jpg"> </a>
  179. <div class="prize">¥ 38.00 </div>
  180. </li>
  181. <li>
  182. <h4> <a href="#">维多利亚葡萄 </a> </h4>
  183. <a href="#"> <img src="images/goods.jpg"> </a>
  184. <div class="prize">¥ 38.00 </div>
  185. </li>
  186. <li>
  187. <h4> <a href="#">维多利亚葡萄 </a> </h4>
  188. <a href="#"> <img src="images/goods.jpg"> </a>
  189. <div class="prize">¥ 38.00 </div>
  190. </li>
  191. </ul>
  192. </div>
  193. </div>
  194. <div class="list_model">
  195. <div class="list_title clearfix">
  196. <h3 class="fl" id="model04">禽类蛋品 </h3>
  197. <div class="subtitle fl">
  198. <span>| </span>
  199. <a href="#">鲜芒 </a>
  200. <a href="#">加州提子 </a>
  201. <a href="#">亚马逊牛油果 </a>
  202. </div>
  203. <a href="#" class="goods_more fr">查看更多 > </a>
  204. </div>
  205. <div class="goods_con clearfix">
  206. <div class="goods_banner fl"> <img src="images/banner04.jpg"> </div>
  207. <ul class="goods_list fl">
  208. <li>
  209. <h4> <a href="#">维多利亚葡萄维多利亚葡萄维多利亚葡萄维多利亚葡萄 </a> </h4>
  210. <a href="#"> <img src="images/goods.jpg"> </a>
  211. <div class="prize">¥ 38.00 </div>
  212. </li>
  213. <li>
  214. <h4> <a href="#">维多利亚葡萄 </a> </h4>
  215. <a href="#"> <img src="images/goods.jpg"> </a>
  216. <div class="prize">¥ 38.00 </div>
  217. </li>
  218. <li>
  219. <h4> <a href="#">维多利亚葡萄 </a> </h4>
  220. <a href="#"> <img src="images/goods.jpg"> </a>
  221. <div class="prize">¥ 38.00 </div>
  222. </li>
  223. <li>
  224. <h4> <a href="#">维多利亚葡萄 </a> </h4>
  225. <a href="#"> <img src="images/goods.jpg"> </a>
  226. <div class="prize">¥ 38.00 </div>
  227. </li>
  228. </ul>
  229. </div>
  230. </div>
  231. <div class="list_model">
  232. <div class="list_title clearfix">
  233. <h3 class="fl" id="model05">新鲜蔬菜 </h3>
  234. <div class="subtitle fl">
  235. <span>| </span>
  236. <a href="#">鲜芒 </a>
  237. <a href="#">加州提子 </a>
  238. <a href="#">亚马逊牛油果 </a>
  239. </div>
  240. <a href="#" class="goods_more fr">查看更多 > </a>
  241. </div>
  242. <div class="goods_con clearfix">
  243. <div class="goods_banner fl"> <img src="images/banner05.jpg"> </div>
  244. <ul class="goods_list fl">
  245. <li>
  246. <h4> <a href="#">维多利亚葡萄维多利亚葡萄维多利亚葡萄维多利亚葡萄 </a> </h4>
  247. <a href="#"> <img src="images/goods.jpg"> </a>
  248. <div class="prize">¥ 38.00 </div>
  249. </li>
  250. <li>
  251. <h4> <a href="#">维多利亚葡萄 </a> </h4>
  252. <a href="#"> <img src="images/goods.jpg"> </a>
  253. <div class="prize">¥ 38.00 </div>
  254. </li>
  255. <li>
  256. <h4> <a href="#">维多利亚葡萄 </a> </h4>
  257. <a href="#"> <img src="images/goods.jpg"> </a>
  258. <div class="prize">¥ 38.00 </div>
  259. </li>
  260. <li>
  261. <h4> <a href="#">维多利亚葡萄 </a> </h4>
  262. <a href="#"> <img src="images/goods.jpg"> </a>
  263. <div class="prize">¥ 38.00 </div>
  264. </li>
  265. </ul>
  266. </div>
  267. </div>
  268. <div class="list_model">
  269. <div class="list_title clearfix">
  270. <h3 class="fl" id="model06">速冻食品 </h3>
  271. <div class="subtitle fl">
  272. <span>| </span>
  273. <a href="#">鲜芒 </a>
  274. <a href="#">加州提子 </a>
  275. <a href="#">亚马逊牛油果 </a>
  276. </div>
  277. <a href="#" class="goods_more fr">查看更多 > </a>
  278. </div>
  279. <div class="goods_con clearfix">
  280. <div class="goods_banner fl"> <img src="images/banner06.jpg"> </div>
  281. <ul class="goods_list fl">
  282. <li>
  283. <h4> <a href="#">维多利亚葡萄维多利亚葡萄维多利亚葡萄维多利亚葡萄 </a> </h4>
  284. <a href="#"> <img src="images/goods.jpg"> </a>
  285. <div class="prize">¥ 38.00 </div>
  286. </li>
  287. <li>
  288. <h4> <a href="#">维多利亚葡萄 </a> </h4>
  289. <a href="#"> <img src="images/goods.jpg"> </a>
  290. <div class="prize">¥ 38.00 </div>
  291. </li>
  292. <li>
  293. <h4> <a href="#">维多利亚葡萄 </a> </h4>
  294. <a href="#"> <img src="images/goods.jpg"> </a>
  295. <div class="prize">¥ 38.00 </div>
  296. </li>
  297. <li>
  298. <h4> <a href="#">维多利亚葡萄 </a> </h4>
  299. <a href="#"> <img src="images/goods.jpg"> </a>
  300. <div class="prize">¥ 38.00 </div>
  301. </li>
  302. </ul>
  303. </div>
  304. </div>
  305. <div class="footer">
  306. <div class="foot_link">
  307. <a href="#">关于我们 </a>
  308. <span>| </span>
  309. <a href="#">联系我们 </a>
  310. <span>| </span>
  311. <a href="#">招聘人才 </a>
  312. <span>| </span>
  313. <a href="#">友情链接 </a>
  314. </div>
  315. <p>CopyRight © 2016 北京天天生鲜信息技术有限公司 All Rights Reserved </p>
  316. <p>电话:010-****888 京ICP备*******8号 </p>
  317. </div>
  318. <script type="text/javascript" src="js/slideshow.js"> </script>
  319. <script type="text/javascript">
  320. BCSlideshow( 'focuspic');
  321. var oFruit = document.getElementById( 'fruit_more');
  322. var oShownum = document.getElementById( 'show_count');
  323. var hasorder = localStorage.getItem( 'order_finish');
  324. if(hasorder)
  325. {
  326. oShownum.innerHTML = '2';
  327. }
  328. oFruit.onclick = function(){
  329. window.location.href = 'list.html';
  330. }
  331. </script>
  332. </body>
  333. </html>


Css格式文件代码:


  
  1. body{ font-family: 'Microsoft Yahei'; font-size: 12px; color: #666;}
  2. html, body{ height: 100%}
  3. /* 顶部样式 */
  4. .header_con{
  5. background-color: #f7f7f7;
  6. height: 29px;
  7. border-bottom: 1px solid #dddddd
  8. }
  9. .header{
  10. width: 1200px;
  11. height: 29px;
  12. margin: 0 auto;
  13. }
  14. .welcome, .login_info, .login_btn, .user_link{
  15. line-height: 29px;
  16. }
  17. .login_info{
  18. display:none;
  19. }
  20. .login_info em{ color: #ff8800}
  21. .login_btn a, .user_link a{
  22. color: #666;
  23. }
  24. .login_btn a :hover, .user_link a :hover{
  25. color: #ff8800;
  26. }
  27. .login_btn span, .user_link span{
  28. color: #cecece;
  29. margin: 0 10px;
  30. }
  31. /* logo、搜索框、购物车样式 */
  32. .search_bar{ width: 1200px; height: 115px; margin: 0 auto;}
  33. .logo{ width: 150px; height: 59px; margin: 29px 0 0 17px;}
  34. .search_con{ width: 616px; height: 38px; border: 1px solid #37ab40; margin: 34px 0 0 124px; background: url(../images/icons.png) 10px - 338px no-repeat;}
  35. .search_con .input_text{ width: 470px; height: 34px; border: 0px; margin: 2px 0 0 36px; outline:none; font-size: 12px; color: #737272; font-family: 'Microsoft Yahei'}
  36. .search_con .input_btn{
  37. width: 100px; height: 38px; background-color: #37ab40; border: 0px; font-size: 14px; color: #fff; font-family: 'Microsoft Yahei'; outline:none; cursor:pointer;
  38. }
  39. .guest_cart{
  40. width: 200px; height: 40px; margin-top: 34px;
  41. }
  42. .guest_cart .cart_name{
  43. width: 158px; height: 38px; line-height: 38px; border: 1px solid #dddddd; display:block; background: url(../images/icons.png) 13px - 300px no-repeat; font-size: 14px; color: #37ab40; text-indent: 56px;
  44. }
  45. .guest_cart .goods_count{
  46. width: 40px; height: 40px; text-align:center; line-height: 40px; font-size: 18px;
  47. font-weight:bold; color: #fff; background-color: #ff8800;
  48. }
  49. /* 菜单、幻灯片样式 */
  50. .navbar_con{ height: 40px; border-bottom: 2px solid #39a93e}
  51. .navbar{ width: 1200px; margin: 0 auto;}
  52. .navbar h1{ width: 200px; height: 40px; line-height: 40px; text-align: center; font-size: 14px; color: #fff; background-color: #39a93e;}
  53. .navbar .subnav_con{ width: 200px; height: 40px; background-color: #39a93e; position:relative; cursor:pointer;}
  54. .navbar .subnav_con h1{ position:absolute; left: 0; top: 0; text-align:left; text-indent: 40px}
  55. .navbar .subnav_con span{ display:block; width: 16px; height: 9px; background: url(../images/down.png) no-repeat; position:absolute; right: 27px; top: 16px; transition:all 300ms ease-in;
  56. }
  57. .navbar .subnav_con :hover span{ transform: rotateZ( 180deg)}
  58. .navbar .subnav_con .subnav{ position:absolute; left: 0; top: 40px; display:none; border-top: 2px solid #39a93e;}
  59. .navbar .subnav_con :hover .subnav{ display:block;}
  60. .navlist{ margin-left: 34px;}
  61. .navlist li{ height: 40px; float:left; line-height: 40px;}
  62. .navlist li a{ color: #666; font-size: 14px}
  63. .navlist li a :hover{ color: #ff8800}
  64. .navlist .interval{ margin: 0 15px;}
  65. .center_con{ width: 1200px; height: 270px; margin: 0 auto;}
  66. .subnav{ width: 198px; height: 270px; border-left: 1px solid #eee; border-right: 1px solid #eee;}
  67. .subnav li{ height: 44px; border-bottom: 1px solid #eee; background: url(../images/icons.png) 178px - 257px no-repeat #fff;}
  68. .subnav li a{ display:block; height: 44px; line-height: 44px; text-indent: 71px; font-size: 14px; color: #333}
  69. .subnav li a :hover{ color: #ff8800}
  70. .subnav li .fruit{ background: url(../images/icons.png) 28px 0px no-repeat;}
  71. .subnav li .seafood{ background: url(../images/icons.png) 28px - 43px no-repeat;}
  72. .subnav li .meet{ background: url(../images/icons.png) 28px - 86px no-repeat;}
  73. .subnav li .egg{ background: url(../images/icons.png) 28px - 132px no-repeat;}
  74. .subnav li .vegetables{ background: url(../images/icons.png) 28px - 174px no-repeat;}
  75. .subnav li .ice{ background: url(../images/icons.png) 28px - 220px no-repeat;}
  76. .slide{ width: 760px; height: 270px; position:relative; overflow:hidden;}
  77. .slide .slide_pics{ position:relative; left: 0; top: 0; width: 760px; height: 270px;}
  78. .slide .slide_pics li{ width: 760px; height: 270px; position:absolute; left: 0; top: 0}
  79. .slide .prev, .slide .next{ width: 17px; height: 23px; background: url(../images/icons.png) left - 388px no-repeat; position:absolute; left: 11px; top: 122px; cursor:pointer;}
  80. .slide .next{ background-position:left - 428px; left: 732px;}
  81. .points{ width: 100%; height: 11px; position:absolute; left: 0; top: 250px; text-align:center;}
  82. .points li{ display:inline-block; width: 11px; height: 11px; margin: 0 5px; background-color: #9f9f9f; border-radius: 50%; cursor:pointer;}
  83. .points li .active{ background-color: #cecece}
  84. .adv{ width: 240px; height: 270px; overflow:hidden; background-color:gold;}
  85. .adv a{ display:block; float:left;}
  86. /* 商品列表样式 */
  87. .list_model{ width: 1200px; height: 340px; margin: 15px auto 0;}
  88. .list_title{ height: 40px; border-bottom: 2px solid #42ad46}
  89. .list_title h3{ height: 40px; line-height: 40px; font-size: 16px; color: #37ab40; font-weight:bold;}
  90. .list_title .subtitle{ height: 20px; line-height: 20px; margin-top: 15px;}
  91. .list_title .subtitle span{ color: #666; margin: 0 10px 0 20px;}
  92. .list_title .subtitle a{ color: #666; margin: 0 5px;}
  93. .list_title .subtitle a :hover, .goods_more :hover{ color: #ff8800}
  94. .goods_more{ height: 20px; margin-top: 15px; color: #666}
  95. .goods_con{ height: 300px;}
  96. .goods_banner{ width: 200px; height: 300px;}
  97. .goods_banner img{ width: 200px; height: 300px;}
  98. .goods_list{ width: 1000px; height: 299px; border-bottom: 1px solid #ededed}
  99. .goods_list li{ height: 299px; width: 249px; border-right: 1px solid #ededed; float:left}
  100. .goods_list li :hover{ width: 248px; height: 297px; border: 1px solid gold;}
  101. .goods_list li :hover img{ opacity: 0.8}
  102. .goods_list li h4{ width: 200px; height: 50px; margin: 20px auto 0; text-align:center;}
  103. .goods_list li h4 a{ font-size: 14px; color: #666; font-weight:normal; line-height: 24px;}
  104. .goods_list li h4 a :hover{ color: #ff8800}
  105. .goods_list li img{ display:block; width: 180px; height: 180px; margin: 0 auto;}
  106. .goods_list li .prize{ text-align:center; font-size: 20px; color: #c40000; margin-top: 5px;}
  107. /* 页面底部样式 */
  108. .footer{
  109. border-top: 2px solid #42ad46;
  110. margin: 30px 0;
  111. }
  112. .foot_link{ text-align:center; margin-top: 30px;}
  113. .foot_link a, .foot_link span{ color: #4e4e4e;}
  114. .foot_link a :hover{ color: #ff8800}
  115. .foot_link span{ padding: 0 10px}
  116. .footer p{ text-align:center; margin-top: 10px;}
  117. /* 二级页面面包屑导航 */
  118. .breadcrumb{
  119. width: 1200px; height: 40px; margin: 0 auto;
  120. }
  121. .breadcrumb a{ line-height: 40px; color: #37ab40}
  122. .breadcrumb a :hover{ color: #ff8800}
  123. .breadcrumb span{ line-height: 40px; color: #666; padding: 0 5px;}
  124. .main_wrap{ width: 1200px; margin: 0 auto;}
  125. .l_wrap{ width: 200px;}
  126. .r_wrap{ width: 980px;}
  127. /* 新品推荐样式 */
  128. .new_goods{
  129. border: 1px solid #ededed;
  130. border-top: 2px solid #37ab40;
  131. padding-bottom: 10px;
  132. }
  133. .new_goods h3{
  134. height: 33px; line-height: 33px; background-color: #fcfcfc; border-bottom: 1px solid #ededed; font-size: 14px; font-weight:normal; text-indent: 10px;
  135. }
  136. .new_goods ul{ width: 160px; margin: 0 auto; overflow:hidden;}
  137. .new_goods li{ border-bottom: 1px solid #ededed; margin-bottom:- 1px;}
  138. .new_goods li img{ display:block; width: 150px; height: 150px; margin: 10px auto;}
  139. .new_goods li h4{ width: 160px; margin: 0 auto;}
  140. .new_goods li h4 a{ font-weight:normal; color: #666; display:block; width: 160px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;}
  141. .new_goods li .prize{ font-size: 14px; color: #da260e; margin: 10px auto;}
  142. /* 商品列表样式 */
  143. .sort_bar{ height: 30px; background-color: #f0fdec}
  144. .sort_bar a{ display:block; height: 30px; line-height: 30px; padding: 0 20px; float:left; color: #000}
  145. .sort_bar .active{ background-color: #37ab40; color: #fff;}
  146. .goods_type_list{
  147. margin: 10px auto 0;
  148. }
  149. .goods_type_list li{
  150. width: 196px;
  151. float:left;
  152. margin-bottom: 10px
  153. }
  154. .goods_type_list li img{ width: 160px; height: 160px; display:block; margin: 10px auto;}
  155. .goods_type_list li h4{ width: 160px; margin: 0 auto;}
  156. .goods_type_list li h4 a{ font-weight:normal; color: #666; display:block; width: 160px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;}
  157. .operate{ width: 160px; margin: 10px auto; position:relative;}
  158. .goods_type_list .operate .prize{ color: #da260e; font-size: 14px;}
  159. .goods_type_list .operate .unit{ color: #999; padding-left: 5px;}
  160. .goods_type_list .operate .add_goods{ display:inline-block; width: 15px; height: 15px; background: url(../images/shop_cart.png); position:absolute; right: 0; top: 3px;}
  161. /* 分页样式 */
  162. .pagenation{ height: 32px; text-align:center; font-size: 0; margin: 30px auto;}
  163. .pagenation a{ display:inline-block; border: 1px solid #d2d2d2; background-color: #f8f6f7; font-size: 12px; padding: 7px 10px; color: #666; margin: 5px}
  164. .pagenation .active{ background-color: #fff; color: #43a200}
  165. /* 商品详情样式 */
  166. .goods_detail_con{
  167. width: 1198px;
  168. height: 398px;
  169. border: 1px solid #ededed;
  170. margin: 0 auto 20px;
  171. }
  172. .goods_detail_pic{ width: 350px; height: 350px; margin: 24px 0 0 24px;}
  173. .goods_detail_list{
  174. width: 730px; height: 350px; margin: 24px 24px 0 0;
  175. }
  176. .goods_detail_list h3{ font-size: 24px; line-height: 24px; color: #666; font-weight:normal;}
  177. .goods_detail_list p{ color: #666; line-height: 40px;}
  178. .prize_bar{ height: 72px; background-color: #fff5f5; line-height: 72px;}
  179. .prize_bar .show_pirze{ font-size: 20px; color: #ff3e3e; padding-left: 20px}
  180. .prize_bar .show_pirze em{ font-style:normal; font-size: 36px; padding-left: 10px}
  181. .prize_bar .show_unit{ padding-left: 150px}
  182. .goods_num{ height: 52px; margin-top: 19px;}
  183. .goods_num .num_name{ width: 70px; height: 52px; line-height: 52px;}
  184. .goods_num .num_add{ width: 75px; height: 50px; border: 1px solid #dddddd}
  185. .goods_num .num_add input{ width: 49px; height: 50px; text-align:center; line-height: 50px; border: 0px; outline:none; font-size: 14px; color: #666}
  186. .goods_num .num_add .add, .goods_num .num_add .minus{ width: 25px; line-height: 25px; text-align:center; border-left: 1px solid #ddd; border-bottom: 1px solid #ddd; color: #666; font-size: 14px}
  187. .goods_num .num_add .minus{ border-bottom: 0px}
  188. .total{ height: 35px; line-height: 35px; margin-top: 25px;}
  189. .total em{ font-style:normal; color: #ff3e3e; font-size: 18px}
  190. .operate_btn{ height: 40px; margin-top: 35px; font-size: 0; position:relative;}
  191. .operate_btn .buy_btn, .operate_btn .add_cart{ display:inline-block; width: 178px; height: 38px; border: 1px solid #c40000; font-size: 14px; color: #c40000; line-height: 38px; text-align:center; background-color: #ffeded;}
  192. .operate_btn .add_cart{ background-color: #c40000; color: #fff; margin-left: 10px; position:relative; z-index: 10;}
  193. .add_jump{ width: 20px; height: 20px; background-color: #c40000; position:absolute; left: 268px; top: 10px; border-radius: 50%; z-index: 9; display:none;}
  194. .detail_tab{
  195. height: 35px;
  196. border-bottom: 1px solid #37ab40
  197. }
  198. .detail_tab li{ height: 34px; line-height: 34px; padding: 0 30px; font-size: 14px; color: #333333; float:left; border: 1px solid #e8e8e8; border-bottom: 0px; cursor:pointer; background-color: #faf8f8}
  199. .detail_tab li .active{ border-top: 2px solid #37ab40; position:relative; background-color: #fff; border-left: 1px solid #37ab40; border-right: 1px solid #37ab40; top:- 1px; height: 35px;}
  200. .tab_content dt{ margin-top: 10px; font-size: 16px; color: #044d39}
  201. .tab_content dd{ line-height: 24px; margin-top: 5px;}
  202. /* 登录页 */
  203. .login_top{ width: 960px; height: 130px; margin: 0 auto;}
  204. .login_logo{ display:block; width: 193px; height: 76px; margin-top: 30px;}
  205. .login_form_bg{ height: 480px; background-color: #518e17}
  206. .no-mp{ margin-top: 0px;}
  207. .login_form_wrap{ width: 960px; height: 480px; margin: 0 auto;}
  208. .login_banner{ width: 381px; height: 322px; background: url(../images/login_banner.png) no-repeat; margin-top: 90px;}
  209. .slogan{ width: 40px; height: 300px; font-size: 30px; color: #f0f9e8; text-align:center; line-height: 36px; margin: 80px 0 0 120px}
  210. .login_form{ width: 368px; height: 378px; border: 1px solid #c6c6c5; background-color: #fff; margin-top: 50px;}
  211. .login_title{ height: 60px; width: 308px; margin: 10px auto; border-bottom: 1px solid #e0e0e0;}
  212. .login_title h1{ font-size: 24px; height: 60px; line-height: 60px; color: #a8a8a8; float:left; font-weight:bold; margin-left: 44px;}
  213. .login_title a{ width: 100px; height: 20px; display:block; font-size: 16px; color: #5fb42a; text-indent: 26px; background: url(../images/icons02.png) left 5px no-repeat; float:left; margin: 20px 0 0 36px}
  214. .form_input{ width: 308px; height: 250px; margin: 20px auto; position:relative;}
  215. .name_input, .pass_input{ width: 306px; height: 36px; border: 1px solid #e0e0e0; background: url(../images/icons02.png) 280px - 41px no-repeat #f8f8f8; outline:none; font-size: 14px; text-indent: 10px; position: absolute; left: 0; top: 0}
  216. .pass_input{ top: 65px; background-position: 280px - 95px;}
  217. .user_error, .pwd_error{ color: #f00; position:absolute; left: 0; top: 43px; /*display:none*/}
  218. .pwd_error{ top: 110px;}
  219. .more_input{ position:absolute; left: 0; top: 130px; width: 100%}
  220. .more_input input{ float:left; margin-top: 2px;}
  221. .more_input label{ float:left; margin-left: 10px;}
  222. .more_input a{ float:right; color: #666}
  223. .more_input a :hover{ color: #ff8800}
  224. .input_submit{ width: 100%; height: 40px; position:absolute; left: 0; top: 180px; background-color: #47aa34; color: #fff; font-size: 22px; border: 0px; font-family: 'Microsoft Yahei'; cursor:pointer;}
  225. /* 注册页面 */
  226. .register_con{
  227. width: 700px;
  228. height: 560px;
  229. margin: 50px auto 0;
  230. background: url(../images/interval_line.png) 300px top no-repeat;
  231. }
  232. .l_con{ width: 300px;}
  233. .reg_logo{ width: 200px; height: 76px; float:right; margin-right: 30px;}
  234. .reg_slogan{ width: 300px; height: 30px; float:right; text-align:right; font-size: 24px; color: #69a81e; margin: 20px 30px 0 0;}
  235. .reg_banner{ width: 251px; height: 329px; background: url(../images/register_banner.png) no-repeat; float:right; margin: 20px 10px 0 0; opacity: 0.5}
  236. .r_con{ width: 400px;}
  237. .reg_title{ width: 360px; height: 50px; float:left; margin-left: 30px; border-bottom: 1px solid #e0e0e0}
  238. .reg_title h1{ height: 50px; line-height: 50px; float:left; font-size: 24px; color: #a8a8a8; font-weight:bold;}
  239. .reg_title a{ float:right; height: 20px; line-height: 20px; font-size: 16px; color: #5fb42a; padding-right: 20px; background: url(../images/icons02.png) 35px 3px no-repeat; margin-top: 15px}
  240. .reg_form{ width: 360px; margin: 30px 0 0 30px; float:left; position:relative;}
  241. .reg_form li{ height: 70px;}
  242. .reg_form li label{ width: 70px; height: 40px; line-height: 40px; float:left; font-size: 14px; color: #a8a8a8}
  243. .reg_form li input{ width: 288px; height: 38px; border: 1px solid #e0e0e0; float:left; outline:none; text-indent: 10px; background-color: #f8f8f8}
  244. .reg_form li .agreement input{ width: 15px; height: 15px; float:left; margin-top: 13px}
  245. .reg_form li .agreement label{ width: 300px; float:left; margin-left: 10px;}
  246. .reg_form li .reg_sub input{ width: 360px; height: 40px; background-color: #47aa34; font-size: 18px; color: #fff; font-family: 'Microsoft Yahei'; cursor:pointer;}
  247. .reg_form li .error_tip{ float:left; height: 30px; line-height: 30px; margin-left: 70px; color: #e62e2e; display:none;}
  248. .reg_form li .error_tip2{ float:left; height: 20px; line-height: 20px; color: #e62e2e; display:none;}
  249. .sub_page_name{ font-size: 18px; color: #666; margin: 50px 0 0 20px}
  250. .total_count{
  251. width: 1200px; margin: 0 auto; height: 40px; line-height: 40px; font-size: 14px;
  252. }
  253. .total_count em{
  254. font-size: 16px; color: #ff4200; margin: 0 5px;
  255. }
  256. .cart_list_th{ width: 1198px; border: 1px solid #ddd; background-color: #f7f7f7; margin: 0 auto;}
  257. .cart_list_th li{ height: 40px; line-height: 40px; float:left; text-align:center;}
  258. .cart_list_th .col01{ width: 26%;}
  259. .cart_list_th .col02{ width: 16%;}
  260. .cart_list_th .col03{ width: 13%;}
  261. .cart_list_th .col04{ width: 12%;}
  262. .cart_list_th .col05{ width: 15%;}
  263. .cart_list_th .col06{ width: 18%;}
  264. .cart_list_td{ width: 1198px; border: 1px solid #ddd; background-color: #edfff9; margin: 0 auto; margin-top:- 1px;}
  265. .cart_list_td li{ height: 120px; line-height: 120px; float:left; text-align:center;}
  266. .cart_list_td .col01{ width: 4%;}
  267. .cart_list_td .col02{ width: 12%;}
  268. .cart_list_td .col03{ width: 10%;}
  269. .cart_list_td .col04{ width: 16%;}
  270. .cart_list_td .col05{ width: 13%;}
  271. .cart_list_td .col06{ width: 12%;}
  272. .cart_list_td .col07{ width: 15%;}
  273. .cart_list_td .col08{ width: 18%;}
  274. .cart_list_td .col02 img{ width: 100px; height: 100px; border: 1px solid #ddd; display:block; margin: 10px auto 0;}
  275. .cart_list_td .col03{ height: 48px; text-align:left; line-height: 24px; margin-top: 38px;}
  276. .cart_list_td .col03 em{ color: #999}
  277. .cart_list_td .col08 a{ color: #666}
  278. .cart_list_td .col06 .num_add{ width: 98px; height: 28px; border: 1px solid #ddd; margin: 40px auto 0;}
  279. .cart_list_td .col06 .num_add a{ width: 29px; height: 28px; line-height: 28px; background-color: #f3f3f3; font-size: 14px; color: #666}
  280. .cart_list_td .col06 .num_add input{ width: 38px; height: 28px; text-align:center; line-height: 30px; border: 0px; display:block; float:left; outline:none; border-left: 1px solid #ddd; border-right: 1px solid #ddd;}
  281. .settlements{ width: 1198px; height: 78px; border: 1px solid #ddd; background-color: #fff4e8; margin:- 1px auto 0;}
  282. .settlements li{ line-height: 78px; float:left;}
  283. .settlements .col01{ width: 4%; text-align:center}
  284. .settlements .col02{ width: 12%;}
  285. .settlements .col03{ width: 69%; height: 48px; line-height: 28px; text-align:right; margin-top: 10px;}
  286. .settlements .col03 span{ color: #ff0000; padding-right: 5px}
  287. .settlements .col03 em{ color: #ff3d3d; font-size: 22px; font-weight:bold;}
  288. .settlements .col03 span{ color: #ff0000;}
  289. .settlements .col03 b{ color: #ff0000; font-size: 14px; padding: 0 5px;}
  290. .settlements .col04{ width: 14%; text-align:center; float:right;}
  291. .settlements .col04 a{ display:block; height: 78px; background-color: #ff3d3d; text-align:center; line-height: 78px; color: #fff; font-size: 24px}
  292. .common_title{ width: 1200px; margin: 20px auto 0; font-size: 14px;}
  293. .common_list_con{ width: 1200px; border: 1px solid #dddddd; border-top: 2px solid #00bc6f; margin: 10px auto 0; background-color: #f7f7f7; position:relative;}
  294. .common_list_con dl{ margin: 20px;}
  295. .common_list_con dt{ font-size: 14px; font-weight:bold; margin-bottom: 10px}
  296. .common_list_con dd input{ vertical-align:bottom; margin-right: 10px}
  297. .edit_site{ position:absolute; right: 20px; top: 30px; width: 100px; height: 30px; background-color: #37ab40; text-align:center; line-height: 30px; color: #fff}
  298. .pay_style_con{ margin: 20px;}
  299. .pay_style_con input{ float:left; margin: 14px 7px 0 0;}
  300. .pay_style_con label{ float:left; border: 1px solid #ccc; background-color: #fff; padding: 10px 10px 10px 40px; margin-right: 25px}
  301. .pay_style_con .cash{ background: url(../images/pay_icons.png) 8px top no-repeat #fff;}
  302. .pay_style_con .weixin{ background: url(../images/pay_icons.png) 6px - 36px no-repeat #fff;}
  303. .pay_style_con .zhifubao{ background: url(../images/pay_icons.png) 12px - 72px no-repeat #fff; width: 50px; height: 16px}
  304. .pay_style_con .bank{ background: url(../images/pay_icons.png) 6px - 108px no-repeat #fff;}
  305. .goods_list_th{ height: 40px; border-bottom: 1px solid #ccc}
  306. .goods_list_th li{ float:left; line-height: 40px; text-align:center;}
  307. .goods_list_th .col01{ width: 25%}
  308. .goods_list_th .col02{ width: 20%}
  309. .goods_list_th .col03{ width: 25%}
  310. .goods_list_th .col04{ width: 15%}
  311. .goods_list_th .col05{ width: 15%}
  312. .goods_list_td{ height: 80px; border-bottom: 1px solid #eeeded}
  313. .goods_list_td li{ float:left; line-height: 80px; text-align:center;}
  314. .goods_list_td .col01{ width: 4%}
  315. .goods_list_td .col02{ width: 6%}
  316. .goods_list_td .col03{ width: 15%}
  317. .goods_list_td .col04{ width: 20%}
  318. .goods_list_td .col05{ width: 25%}
  319. .goods_list_td .col06{ width: 15%}
  320. .goods_list_td .col07{ width: 15%}
  321. .goods_list_td .col02{ text-align:right}
  322. .goods_list_td .col02 img{ width: 63px; height: 63px; border: 1px solid #ddd; display:block; margin: 7px 0; float:right;}
  323. .goods_list_td .col03{ text-align:left; text-indent: 20px}
  324. .settle_con{ margin: 10px}
  325. .total_goods_count, .transit, .total_pay{ line-height: 24px; text-align:right}
  326. .total_goods_count em, .total_goods_count b, .transit b, .total_pay b{ font-size: 14px; color: #ff4200; padding: 0 5px;}
  327. .order_submit{ width: 1200px; margin: 20px auto;}
  328. .order_submit a{ width: 160px; height: 40px; line-height: 40px; text-align:center; background-color: #47aa34; color: #fff; font-size: 16px; display:block; float:right}
  329. .order_list_th{ width: 1198px; border: 1px solid #ddd; background-color: #f7f7f7; margin: 20px auto 0;}
  330. .order_list_th li{ float:left; height: 30px; line-height: 30px}
  331. .order_list_th .col01{ width: 20%; margin-left: 20px}
  332. .order_list_th .col02{ width: 20%}
  333. .order_list_table{
  334. width: 1200px;
  335. border-collapse:collapse;
  336. border-spacing: 0px;
  337. border: 1px solid #ddd;
  338. margin:- 1px auto 0;
  339. }
  340. .order_list_table td{
  341. border: 1px solid #ddd;
  342. text-align:center;
  343. }
  344. .order_goods_list{ border-bottom: 1px solid #ddd; margin-bottom:- 2px;}
  345. .order_goods_list li{ float:left; height: 80px; line-height: 80px;}
  346. .order_goods_list .col01{ width: 20%}
  347. .order_goods_list .col01 img{ width: 60px; height: 60px; border: 1px solid #ddd; margin: 10px auto;}
  348. .order_goods_list .col02{ width: 50%; text-align:left;}
  349. .order_goods_list .col02 em{ color: #999; margin-left: 10px}
  350. .order_goods_list .col03{ width: 10%}
  351. .order_goods_list .col04{ width: 20%}
  352. .oper_btn{ display:inline-block; border: 1px solid #ddd; color: #666; padding: 5px 10px}
  353. .popup_con{ display:none;}
  354. .popup{ width: 300px; height: 150px; border: 1px solid #dddddd; border-top: 2px solid #00bc6f; background-color: #f7f7f7; position:fixed;
  355. left: 50%;
  356. margin-left:- 150px;
  357. top: 50%;
  358. margin-top:- 75px;
  359. z-index: 1000;
  360. }
  361. .popup p{ height: 150px; line-height: 150px; text-align:center; font-size: 18px;}
  362. .mask{ width: 100%; height: 100%; position:fixed; left: 0; top: 0; background-color: #000; opacity: 0.3; z-index: 999;}
  363. .main_con{
  364. width: 1200px;
  365. margin: 0 auto;
  366. background: url(../images/left_bg.jpg) repeat-y;
  367. }
  368. .left_menu_con{
  369. width: 200px;
  370. float:left;
  371. }
  372. .left_menu_con h3{
  373. font-size: 16px;
  374. line-height: 40px;
  375. border-bottom: 1px solid #ddd;
  376. text-align:center;
  377. margin-bottom: 10px;
  378. }
  379. .left_menu_con ul li{
  380. line-height: 40px;
  381. text-align:center;
  382. font-size: 14px;
  383. }
  384. .left_menu_con ul li a{
  385. color: #666;
  386. }
  387. .left_menu_con ul li .active{
  388. color: #ff8800;
  389. font-weight:bold;
  390. }
  391. .right_content{
  392. width: 980px;
  393. float:right;
  394. min-height: 500px;
  395. }
  396. .w980{
  397. width: 980px;
  398. }
  399. .w978{
  400. width: 978px;
  401. }
  402. .common_title2{ height: 20px; line-height: 20px; font-size: 16px; margin: 10px 0;}
  403. .user_info_list{
  404. background-color: #f9f9f9;
  405. margin: 10px 0 15px;
  406. padding: 10px 0;
  407. height: 90px;
  408. }
  409. .user_info_list li{
  410. line-height: 30px;
  411. text-indent: 30px;
  412. font-size: 14px;
  413. }
  414. .user_info_list li span{
  415. width: 100px;
  416. float:left;
  417. text-align:right;
  418. }
  419. .info_con{
  420. width: 980px;
  421. }
  422. .info_l{
  423. width: 600px;
  424. float:left;
  425. }
  426. .info_r{
  427. width: 360px;
  428. float:right;
  429. }
  430. .site_con{
  431. background-color: #f9f9f9;
  432. padding: 10px 0;
  433. margin-bottom: 20px;
  434. }
  435. .site_con dt{
  436. font-size: 14px;
  437. line-height: 30px;
  438. text-indent: 30px;
  439. font-weight:bold;
  440. }
  441. .site_con dd{
  442. font-size: 14px;
  443. line-height: 30px;
  444. text-indent: 30px;
  445. }
  446. .site_con .form_group{
  447. height: 40px;
  448. line-height: 40px;
  449. margin-top: 10px;
  450. }
  451. .site_con .form_group label{
  452. width: 100px;
  453. float:left;
  454. text-align:right;
  455. font-size: 14px;
  456. height: 40px;
  457. line-height: 40px;
  458. }
  459. .site_con .form_group input{
  460. width: 300px;
  461. height: 25px;
  462. border: 1px solid #ddd;
  463. float:left;
  464. outline:none;
  465. margin-top: 7px;
  466. text-indent: 10px;
  467. }
  468. .site_con .form_group2{
  469. height: 90px;
  470. }
  471. .site_area{
  472. width: 280px;
  473. height: 60px;
  474. border: 1px solid #ddd;
  475. outline:none;
  476. padding: 10px;
  477. }
  478. .info_submit{
  479. width: 80px;
  480. height: 30px;
  481. background-color: #37ab40;
  482. border: 0px;
  483. color: #fff;
  484. margin: 10px 0 10px 100px;
  485. cursor:pointer;
  486. font-family: 'Microsoft Yahei'
  487. }
  488. .stress{
  489. color: #ff8800;
  490. }

五、完整版代码:

代码地址:https://gitee.com/xun527/ttsx.git


转载:https://blog.csdn.net/xun527/article/details/77822274
查看评论
* 以上用户言论只代表其个人观点,不代表本网站的观点或立场