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

预览效果图

秒杀专区部分代码

  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. }

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

更多相关文章

  1. 仿京东移动端首页的"部分"样式
  2. flex布局中容器及项目常用属性演示
  3. 定位以及三行三列布局方式
  4. 7/30号作业
  5. 简单表单与css选择器实战案例
  6. 注册表单实战案例
  7. HTML注册表单控件实例、CSS模块化理解与CSS基本/上下文选择器的
  8. PHP快递查询接口api和快递单号智能判断PHP代码
  9. css语法介绍

随机推荐

  1. Android开发之ConstraintLayout布局
  2. android常用知识(累计)
  3. Android系统自带主题的使用及自定义主题
  4. Android圆角图片
  5. Android系统在超级终端下必会的命令大全(a
  6. 使用系统资源的引用总结以及收到短信后给
  7. Android 之EditText自动弹出/不弹出输入
  8. Android系统的开机画面显示过程分析(4)
  9. android相对布局的案例
  10. Android(安卓)Material Design控件之Card