当前位置:   article > 正文

小米商城html/css_小米商城htmlcss代码

小米商城htmlcss代码

导航条——

  1. <header>
  2. <div class="header-wrap">
  3. <div class="header-left">
  4. <ul>
  5. <li>
  6. <a href="">小米官网</a>
  7. </li>
  8. <li class="space">|</li>
  9. <li>
  10. <a href="">小米商城</a>
  11. </li>
  12. <li class="space">|</li>
  13. <li>
  14. <a href="">MIUI</a>
  15. </li>
  16. <li class="space">|</li>
  17. <li>
  18. <a href="">IoT</a>
  19. </li>
  20. <li class="space">|</li>
  21. <li>
  22. <a href="">云服务</a>
  23. </li>
  24. <li class="space">|</li>
  25. <li>
  26. <a href="">天星数科</a>
  27. </li>
  28. <li class="space">|</li>
  29. <li>
  30. <a href="">有品</a>
  31. </li>
  32. <li class="space">|</li>
  33. <li>
  34. <a href="">小爱开放平台</a>
  35. </li>
  36. <li class="space">|</li>
  37. <li>
  38. <a href="">企业团购</a>
  39. </li>
  40. <li class="space">|</li>
  41. <li>
  42. <a href="">资质证照</a>
  43. </li>
  44. <li class="space">|</li>
  45. <li>
  46. <a href="">协议规则</a>
  47. </li>
  48. <li class="space">|</li>
  49. <li>
  50. <a href="">下载app</a>
  51. <i class="triangle"></i>
  52. <div class="download">
  53. <img src="./download.png">
  54. <p style="font-size:14px ;">小米商城APP</p>
  55. </div>
  56. </li>
  57. <li class="space">|</li>
  58. <li>
  59. <a href="">Selec Location</a>
  60. </li>
  61. </ul>
  62. </div>
  63. <div class="header-right">
  64. <ul>
  65. <li>
  66. <a href="">登录</a>
  67. </li>
  68. <li class="space">|</li>
  69. <li>
  70. <a href="">注册</a>
  71. </li>
  72. <li class="space">|</li>
  73. <li>
  74. <a href="">消息通知</a>
  75. </li>
  76. <li class="space">|</li>
  77. <li class="cart">
  78. <a href="">
  79. <i class="iconfont icon-gouwuche"></i>
  80. 购物车(0)
  81. </a>
  82. <div class="cart-menu">
  83. <span>购物车中还没有商品,赶紧选购吧!</span>
  84. </div>
  85. </li>
  86. </ul>
  87. </div>
  88. </div>
  89. </header>

CSS样式——

  1. /* 头部开始 */
  2. header{
  3. width: 100%;
  4. height: 40px;
  5. background-color: #333;
  6. }
  7. .header-wrap{
  8. width: 1226px;
  9. height: 40px;
  10. margin: 0 auto;
  11. line-height: 40px;
  12. font-size: 12px;
  13. }
  14. .header-wrap a{
  15. color: #b0b0b0;
  16. }
  17. .header-left ul>li:hover>a{
  18. color: #fff;
  19. }
  20. .header-right li:not(.cart):hover>a{
  21. color: #fff;
  22. }
  23. .header-left{
  24. float: left;
  25. }
  26. header li{
  27. position: relative;
  28. padding-left: 2.5px;
  29. padding-right: 2.5px;
  30. }
  31. .header-left li{
  32. float: left;
  33. }
  34. /* 二维码 */
  35. .download{
  36. z-index: 20;
  37. width: 124px;
  38. height: 0;
  39. overflow: hidden;
  40. transition: all .7s;
  41. text-align: center;
  42. line-height: 28px;
  43. background-color: #fff;
  44. box-shadow: 0 2px 10px rgb(0 0 0 / 15%);
  45. position: absolute;
  46. top: 40px;
  47. left: 50%;
  48. margin-left: -62px;
  49. }
  50. .download>img{
  51. width: 90px;
  52. margin: 18px 15px 12px;
  53. }
  54. li:hover>.download{
  55. height: 160px;
  56. }
  57. /* 三角形 */
  58. .triangle{
  59. width: 0px;
  60. height: 10px;
  61. border: 10px solid;
  62. border-color:transparent transparent #fff transparent;
  63. position: absolute;
  64. right: 10px;
  65. top: 10px;
  66. visibility: hidden;
  67. }
  68. .header-left>ul>li:hover>i{
  69. visibility: visible;
  70. }
  71. .header-right{
  72. float: right;
  73. }
  74. .header-right li{
  75. float: left;
  76. }
  77. /* 购物车 */
  78. .cart{
  79. width: 120px;
  80. height: 40px;
  81. background-color: rgba(96, 96, 96,0.3);
  82. text-align: center;
  83. position: relative;
  84. }
  85. .cart i{
  86. margin-right: 4px;
  87. }
  88. .cart:hover>a{
  89. color:#ff6700;
  90. }
  91. .cart:hover{
  92. background-color: #fff;
  93. }
  94. .cart-menu{
  95. z-index: 10;
  96. width: 316px;
  97. height: 0;
  98. overflow: hidden;
  99. text-align: center;
  100. position: absolute;
  101. line-height:80px ;
  102. top: 40px;
  103. right: 0;
  104. background-color: #fff;
  105. box-shadow: 0 2px 10px rgb(0 0 0 / 15%);
  106. transition: all .7s;
  107. }
  108. .cart:hover .cart-menu{
  109. height: 80px;
  110. }
  111. /* 头部结束 */

如有错误,欢迎指正!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/353594
推荐阅读
相关标签
  

闽ICP备14008679号