Blogger Information
Blog 18
fans 0
comment 0
visits 16011
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
京东商城实例
沉寂的博客
Original
976 people have browsed it

京东商城实例

代码如下:

  1. header {
  2. height: 5em;
  3. background-color: lightcoral;
  4. color: white;
  5. display: flex;
  6. padding: 1em;
  7. }
  8. /* 菜单按钮 */
  9. header .menu {
  10. flex: 1;
  11. text-align: center;
  12. font-size: 2.5em;
  13. height: inherit;
  14. }
  15. /* 搜索框 */
  16. header .search {
  17. flex: 8;
  18. display: flex;
  19. align-items: center;
  20. background-color: #fff;
  21. border-radius: 2em;
  22. }
  23. header .search .logo {
  24. font-size: 2em;
  25. color: lightcoral;
  26. margin-left: 0.5em;
  27. }
  28. header .search .zoom {
  29. font-size: 1.5em;
  30. color: #cccccc;
  31. margin-left: 0.2em;
  32. border-left: solid 1px #ccc;
  33. padding: 0.2em;
  34. }
  35. header .search .words {
  36. border: none;
  37. outline: none;
  38. color: #ccc;
  39. background-color: white;
  40. }
  41. /* 登录按钮 */
  42. header .login {
  43. flex: 1;
  44. background-color: lightcoral;
  45. border: none;
  46. outline: none;
  47. color: white;
  48. font-size: 2em;
  49. margin-left: 1em;
  50. }
  51. .container .banner a img {
  52. /* 如果想要图自动缩放效果,宽要占100% */
  53. width: 100%;
  54. }
  55. main .nav {
  56. display: flex;
  57. flex-flow: row wrap;
  58. }
  59. main .nav li {
  60. flex: 1 1 20%;
  61. display: flex;
  62. flex-flow: column nowrap;
  63. align-items: center;
  64. }
  1. <!-- 头部 -->
  2. <header>
  3. <div class="menu iconfont icon-menu"></div>
  4. <div class="search">
  5. <div class="logo">JD</div>
  6. <div class="zoom iconfont icon-search"></div>
  7. <input
  8. type="text"
  9. name="search"
  10. id="search"
  11. value="蓝牙鼠标"
  12. class="words"
  13. />
  14. </div>
  15. <button class="login">登录</button>
  16. </header>
  17. <div class="container">
  18. <div class="banner">
  19. <a href="#"><img src="static/images/bg/banner.jpg" alt="" /></a>
  20. </div>
  21. <main>
  22. <ul class="nav">
  23. <li>
  24. <a href="#"><img src="static/images/dh/nav-1.png" alt="" /></a>
  25. <a href="#">京东超市</a>
  26. </li>
  27. <li>
  28. <a href="#"><img src="static/images/dh/nav-2.png" alt="" /></a>
  29. <a href="#">数码电器</a>
  30. </li>
  31. <li>
  32. <a href="#"><img src="static/images/dh/nav-3.png" alt="" /></a>
  33. <a href="#">京东服饰</a>
  34. </li>
  35. <li>
  36. <a href="#"><img src="static/images/dh/nav-4.png" alt="" /></a>
  37. <a href="#">京东生鲜</a>
  38. </li>
  39. <li>
  40. <a href="#"><img src="static/images/dh/nav-5.png" alt="" /></a>
  41. <a href="#">京东到家</a>
  42. </li>
  43. <li>
  44. <a href="#"><img src="static/images/dh/nav-6.png" alt="" /></a>
  45. <a href="#">充值领劵</a>
  46. </li>
  47. <li>
  48. <a href="#"><img src="static/images/dh/nav-7.png" alt="" /></a>
  49. <a href="#">9.9元拼</a>
  50. </li>
  51. <li>
  52. <a href="#"><img src="static/images/dh/nav-8.png" alt="" /></a>
  53. <a href="#">领劵</a>
  54. </li>
  55. <li>
  56. <a href="#"><img src="static/images/dh/nav-9.png" alt="" /></a>
  57. <a href="#">借钱</a>
  58. </li>
  59. <li>
  60. <a href="#"><img src="static/images/dh/nav-10.png" alt="" /></a>
  61. <a href="#">PLUS会员</a>
  62. </li>
  63. <ul>
  64. </main>
  65. </div>

执行结果:
JD

Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post