博客列表 >关于复刻ewshop商城首页头部的制作

关于复刻ewshop商城首页头部的制作

当时只道是寻常
当时只道是寻常原创
2022年05月10日 10:48:14402浏览

1、轮播图使用了jquery插件

  1. <div class="head">
  2. <div class="wrapper clearfix">
  3. <div class="clearfix" id="top"><h1 class="fl"><a href="index.html"><img src="img/logo.png"/></a></h1>
  4. <div class="fr clearfix" id="top1"><p class="fl"><a href="#" id="login">登录</a><a href="#" id="reg">注册</a>
  5. </p>
  6. <form action="#" method="post" class="fl">
  7. <input type="text" placeholder="热门搜索:干花花瓶"/>
  8. <input type="button"/>
  9. </form>
  10. <div class="btn fl clearfix">
  11. <a href="#">
  12. <img src="img/grzx.png"/>
  13. </a>
  14. <a href="#" class="er1">
  15. <img src="img/ewm.png"/>
  16. </a>
  17. <a href="#">
  18. <img src="img/gwc.png"/>
  19. </a>
  20. <p>
  21. <a href="#">
  22. <img src="img/smewm.png"/>
  23. </a>
  24. </p>
  25. </div>
  26. </div>
  27. </div>
  28. <ul class="clearfix" id="bott">
  29. <li>
  30. <a href="index.html">首页</a>
  31. </li>
  32. <li>
  33. <a href="#">所有商品</a>
  34. <div class="sList">
  35. <div class="wrapper clearfix">
  36. <a href="#">
  37. <dl>
  38. <dt><img src="img/nav1.jpg"/></dt>
  39. <dd>浓情欧式</dd>
  40. </dl>
  41. </a>
  42. <a href="#">
  43. <dl>
  44. <dt><img src="img/nav2.jpg"/></dt>
  45. <dd>浪漫美式</dd>
  46. </dl>
  47. </a>
  48. <a href="#">
  49. <dl>
  50. <dt><img src="img/nav3.jpg"/></dt>
  51. <dd>雅致中式</dd>
  52. </dl>
  53. </a>
  54. <a href="#">
  55. <dl>
  56. <dt><img src="img/nav6.jpg"/></dt>
  57. <dd>简约现代</dd>
  58. </dl>
  59. </a>
  60. <a href="#">
  61. <dl>
  62. <dt><img src="img/nav7.jpg"/></dt>
  63. <dd>创意装饰</dd>
  64. </dl>
  65. </a>
  66. </div>
  67. </div>
  68. </li>
  69. <li><a href="#">装饰摆件</a>
  70. <div class="sList2">
  71. <div class="clearfix"><a href="#">干花花艺</a><a href="#">花瓶花器</a></div>
  72. </div>
  73. </li>
  74. <li><a href="#">布艺软饰</a>
  75. <div class="sList2">
  76. <div class="clearfix"><a href="#">桌布罩件</a><a href="#">抱枕靠垫</a></div>
  77. </div>
  78. </li>
  79. <li><a href="#">墙式壁挂</a></li>
  80. <li><a href="#">蜡艺香薰</a></li>
  81. <li><a href="#">创意家居</a></li>
  82. </ul>
  83. </div>
  84. </div>
  85. <div class="block_home_slider">
  86. <div id="home_slider" class="flexslider">
  87. <ul class="slides">
  88. <li>
  89. <div class="slide"><img src="img/banner2.jpg"/></div>
  90. </li>
  91. <li>
  92. <div class="slide"><img src="img/banner1.jpg"/></div>
  93. </li>
  94. </ul>
  95. </div>
  96. </div>
  1. * {
  2. margin: 0;
  3. padding: 0;
  4. }
  5. /*将所有HTML元素的默认边距清0*/
  6. html, body {
  7. font-size: 12px;
  8. font-family: "微软雅黑", "arial";
  9. color: #262626;
  10. background: #FFF;
  11. }
  12. /*对HTML元素中的字体、颜色、背景色进行初始设置*/
  13. ul li, ol li {
  14. list-style: none;
  15. }
  16. /*将列表标签的默认样式清除*/
  17. a {
  18. text-decoration: none;
  19. outline: none;
  20. color: #262626;
  21. blr: expression(this.onFocus=this.blur());
  22. }
  23. /*将超链接的下划线去掉以及在ie6中点击出现的虚线框去掉*/
  24. img {
  25. border: none;
  26. }
  27. /*图片的默认边框去掉 */
  28. table {
  29. border-collapse: collapse;
  30. border-spacing: 0;
  31. }
  32. caption, th, td {
  33. font-weight: normal;
  34. text-align: left;
  35. }
  36. input, textarea, select, button {
  37. font-size: 100%;
  38. font-family: inherit;
  39. margin: 0;
  40. padding: 0;
  41. border: none;
  42. outline: none;
  43. }
  44. label, button {
  45. cursor: pointer
  46. }
  47. textarea {
  48. white-space: pre;
  49. resize: none;
  50. border: 1px solid #ececec;
  51. }
  52. article, aside, figcaption, figure, footer, header, hgroup, nav, section, summary {
  53. display: block;
  54. }
  55. /*清楚浮动*/
  56. .clearfix:after {
  57. content: "";
  58. display: block;
  59. clear: both;
  60. height: 0;
  61. line-height: 0;
  62. visibility: hidden;
  63. }
  64. .clearfix {
  65. zoom: 1;
  66. }
  67. /*解决ie6的兼容性问题*/
  68. .fl {
  69. float: left;
  70. }
  71. .fr {
  72. float: right;
  73. }
  74. .mt {
  75. margin-top: 80px;
  76. }
  77. .wrapper {
  78. width: 1160px;
  79. margin: 0 auto;
  80. }
  81. /*********************head********************/
  82. .head {
  83. margin-top: 30px;
  84. min-width: 1160px;
  85. position: relative;
  86. border-bottom: 1px solid #e0e0e0;
  87. }
  88. .head h1 img {
  89. width: 80%;
  90. display: block;
  91. }
  92. .head div p {
  93. margin-top: 20px;
  94. }
  95. .head div p a {
  96. color: #262626;
  97. padding: 0 10px;
  98. font-size: 14px;
  99. }
  100. .head div p a:nth-child(1) {
  101. border-right: 1px solid #dbdbdb;
  102. }
  103. .head div form {
  104. width: 160px;
  105. height: 30px;
  106. line-height: 30px;
  107. margin: 0 10px;
  108. margin-top: 13px;
  109. border-bottom: 1px solid #262626;
  110. }
  111. .head div form input:nth-child(1) {
  112. background: none;
  113. text-indent: 8px;
  114. }
  115. .head div form input:nth-child(2) {
  116. float: right;
  117. width: 13%;
  118. padding-bottom: 10px;
  119. background: url("../img/ss.png") no-repeat right 5px;
  120. cursor: pointer;
  121. }
  122. .head div.btn {
  123. margin-top: 20px;
  124. position: relative;
  125. }
  126. .head div.btn a {
  127. float: left;
  128. margin: 0 10px;
  129. }
  130. .head ul {
  131. float: left;
  132. margin-left: 18%;
  133. line-height: 50px;
  134. }
  135. .head ul li {
  136. float: left;
  137. padding: 0 20px;
  138. }
  139. .head ul li > a {
  140. color: #262626;
  141. font-size: 14px;
  142. display: inline-block;
  143. position: relative;
  144. }
  145. .head ul li a:before {
  146. content: "";
  147. background: #A10000;
  148. position: absolute;
  149. bottom: -3px;
  150. z-index: -1;
  151. transform: scaleX(0);
  152. transition: all .5s ease;
  153. -webkit-transition: all .5s ease;
  154. }
  155. .head ul li:nth-child(1) a:before {
  156. left: -12px;
  157. }
  158. .head ul li > a:hover {
  159. color: #A10000;
  160. }
  161. .head ul li > a:hover:before {
  162. width: 56px;
  163. height: 2px;
  164. transform: scaleX(1);
  165. transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);
  166. -webkit-transition-timing-function: cubic-bezier(0.52, 1.64, 0.37, 0.66);;
  167. z-index: 9999;
  168. }
  169. .head div.sList {
  170. position: absolute;
  171. top: 113px;
  172. left: 0;
  173. z-index: 3;
  174. background: #fff;
  175. width: 100%;
  176. display: none;
  177. }
  178. .head div.sList div {
  179. text-align: center;
  180. padding: 20px 0;
  181. display: flex;
  182. }
  183. .head div.sList div a {
  184. flex: 1 1 20%;
  185. border-right: 1px solid #dbdbdb;
  186. }
  187. .head div.sList div a:last-child {
  188. border-right: none;
  189. }
  190. .head div.sList div dl dt img {
  191. width: 70%;
  192. }
  193. .head div.sList div dl dd {
  194. font-size: 14px;
  195. }
  196. .head div.sList2 {
  197. display: none;
  198. position: absolute;
  199. top: 113px;
  200. left: 0;
  201. z-index: 3;
  202. background: #fff;
  203. opacity: 0.5;
  204. width: 100%;
  205. }
  206. .head div.sList2 div {
  207. width: 46%;
  208. margin: 0 auto;
  209. }
  210. .head div.sList2 a {
  211. float: left;
  212. margin-right: 40px;
  213. }
  1. $(function () {
  2. $(".head ul>li").hover(function () {
  3. var a = $(this).children().length;
  4. if (a != 1) {
  5. $(this).children("div").stop().slideToggle(200).end().siblings().children("div").hide()
  6. } else {
  7. $(this).child```javascript
  8. $(function () {
  9. $('#home_slider').flexslider({
  10. animation: 'slide',
  11. controlNav: true,
  12. directionNav: true,
  13. animationLoop: true,
  14. slideshow: true,
  15. slideshowSpeed: 2000,
  16. useCSS: false
  17. });
  18. });
  19. ```ren("div").hide()
  20. }
  21. });
  22. });

![](https://img.php.cn/upload/image/236/232/224/1652150831692241.png)

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议