Blogger Information
Blog 20
fans 0
comment 0
visits 10796
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
将仿京东移动端首页的"秒杀区"样式
麦兜的故事
Original
592 people have browsed it

将仿京东移动端首页的”秒杀区”样式

预览效果图

秒杀专区部分代码

  1. <div class="flash">
  2. <div class="flash_container">
  3. <div class="flash_container_title">
  4. <!-- title_left 设置flex布局 -->
  5. <div class="title_left">
  6. <!-- 把京东秒杀与12点场 放一个块元素中 -->
  7. <div class="title_left_1">
  8. <span style="color:#333">京东秒杀</span>
  9. <span style="padding-left: 0.5rem;color:#ff270c">12</span>
  10. <img src="static/images/aa.png" alt="">
  11. </div>
  12. <!-- 倒计时为一个块元素 -->
  13. <div class="title_left_2">
  14. <span>00</span>
  15. <span style="color:#fa2c19;">:</span>
  16. <span>37</span>
  17. <span style="color:#fa2c19;">:</span>
  18. <span>29</span>
  19. </div>
  20. </div>
  21. <div class="title_right">
  22. <span>更多秒杀</span>
  23. <span >></span>
  24. </div>
  25. </div>
  26. <div style="top: 120rem;">
  27. <ul class="nav">
  28. <li>
  29. <a href=""><img src="static/images/a1.jpg" alt=""> </a>
  30. <span style="color:#ff270c">¥ 32.6</span>
  31. <span style="text-decoration:line-through;color:#999">¥ 38.3</span>
  32. </li>
  33. <li>
  34. <a href=""><img src="static/images/a1.jpg" alt=""> </a>
  35. <span style="color:#ff270c">¥ 32.6</span>
  36. <span style="text-decoration:line-through;color:#999">¥ 38.3</span>
  37. </li>
  38. <li>
  39. <a href=""><img src="static/images/a1.jpg" alt=""> </a>
  40. <span style="color:#ff270c">¥ 32.6</span>
  41. <span style="text-decoration:line-through;color:#999">¥ 38.3</span>
  42. </li>
  43. <li>
  44. <a href=""><img src="static/images/a1.jpg" alt=""> </a>
  45. <span style="color:#ff270c">¥ 32.6</span>
  46. <span style="text-decoration:line-through;color:#999">¥ 38.3</span>
  47. </li>
  48. <li>
  49. <a href=""><img src="static/images/a1.jpg" alt=""> </a>
  50. <span style="color:#ff270c">¥ 32.6</span>
  51. <span style="text-decoration:line-through;color:#999">¥ 38.3</span>
  52. </li>
  53. <li>
  54. <a href=""><img src="static/images/a1.jpg" alt=""> </a>
  55. <span style="color:#ff270c">¥ 32.6</span>
  56. <span style="text-decoration:line-through;color:#999">¥ 38.3</span>
  57. </li>
  58. </ul>
  59. </div>
  60. </div>
  61. </div>

css样式相关代码

  1. /* 秒杀专区 */
  2. .content .flash{
  3. margin-top: 2rem;
  4. }
  5. .content .flash .flash_container{
  6. margin: 0.5rem;
  7. background-color: #fff;
  8. border-radius: 1rem;
  9. }
  10. .content .flash .flash_container_title{
  11. display: flex;
  12. justify-content:space-between;
  13. padding-top: 1rem;
  14. background: url(../images/bg.png) no-repeat;
  15. background-size: contain;
  16. }
  17. /* 左边 */
  18. .content .flash .flash_container_title .title_left{
  19. padding-left: 1rem;
  20. display: flex;
  21. align-items: center;
  22. }
  23. .content .flash .flash_container_title .title_left img{
  24. width:1.8rem;
  25. height:2rem;
  26. }
  27. .content .flash .flash_container_title .title_left .title_left_2{
  28. padding-left:2rem;
  29. }
  30. /* 右边 更多 */
  31. .content .flash .flash_container_title .title_right span:last-child{
  32. display: inline-block;
  33. width:1.5rem;height:1.5rem;
  34. background-color: #fa2c19;
  35. color:#fff;
  36. border-radius:1.6rem;
  37. font-size:1.5rem;
  38. line-height: 1.5rem;
  39. text-align: center;
  40. margin-right: 1rem;
  41. }
  42. .content .flash .flash_container_title .title_left .title_left_2 span:nth-of-type(2n+1){
  43. display:inline-block;
  44. background-color: #fa2c19;
  45. color:#fff;
  46. border-radius:0.5rem;
  47. }
  48. .content .flash .flash_container .nav{
  49. display: flex;
  50. flex-flow: row nowrap;
  51. justify-content: space-around;
  52. flex: 1 1;
  53. }
  54. .content .flash .flash_container .nav li{
  55. display: flex;
  56. flex-flow: column;
  57. align-items: center;
  58. }
  59. .content .flash .flash_container .nav li img{
  60. width:6rem;
  61. height:6rem;
  62. }

其他代码引用和初始化没有放

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