style.less 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. *{
  2. margin: 0;
  3. padding: 0;
  4. }
  5. @total-width:750;
  6. .w{
  7. width: (693/40rem);
  8. margin: 0 auto;
  9. }
  10. // 设置根元素
  11. html{
  12. // 设置rem的比值
  13. font-size: (100vw/@total-width) * 40;
  14. background-color: #eff0f4;
  15. }
  16. a{
  17. text-decoration: none;
  18. }
  19. // 设置头部header
  20. .top-bar:extend(.w){
  21. // 设置弹性容器
  22. display: flex;
  23. // 设置高度
  24. height: (175/40rem);
  25. line-height: (175/40rem);
  26. // 设置对齐方式
  27. justify-content: space-between;
  28. // 设置辅轴的对齐方式
  29. align-items: center;
  30. a{
  31. color: #24253d;
  32. font-size: (50/40rem);
  33. i{
  34. color: #999;
  35. font-size: (40/40rem);
  36. }
  37. }
  38. }
  39. // 设置banner
  40. .banner:extend(.w){
  41. img{
  42. width: 100%;
  43. }
  44. }
  45. // 设置中间菜单
  46. .menu:extend(.w){
  47. // 确定元素的高度
  48. height: (329/40rem);
  49. // 设置弹性元素
  50. display: flex;
  51. // 设置换行
  52. flex-flow: row wrap;
  53. // 设置对齐方式
  54. justify-content: space-between;
  55. // 设置辅轴方向的对齐方式
  56. align-content: space-evenly;
  57. // 设置框的大小
  58. a{
  59. width: (327/40rem);
  60. height: (104/40rem);
  61. line-height: (104/40rem);
  62. color: white;
  63. border-radius: (10/40rem);
  64. i{
  65. margin: 0 (20/40rem) 0 (38/40rem);
  66. }
  67. }
  68. .course{
  69. background-color: #f97053;
  70. }
  71. .star{
  72. background-color: #cd6efe;
  73. }
  74. .sub{
  75. background-color: #fe4479;
  76. }
  77. .download{
  78. background-color: #1bc4fb;
  79. }
  80. }
  81. // 设置课程列表
  82. .course-list:extend(.w){
  83. height: (394/40rem);
  84. display: flex;
  85. flex-flow: column;
  86. justify-content: space-between;
  87. margin-bottom: (46/40rem);
  88. .title{
  89. display: flex;
  90. // 主轴的空间
  91. justify-content: space-between;
  92. // 辅轴的对齐方式
  93. align-items: center;
  94. h2{
  95. font-size: (33/40rem);
  96. color: #24253d;
  97. border-left: 2px solid #3a84ff;
  98. padding: 4px;
  99. }
  100. a{
  101. font-size: (28/40rem);
  102. color: #656565;
  103. }
  104. }
  105. }
  106. // 设置课程列表的项
  107. .item-list{
  108. width: (720/40rem);
  109. display: flex;
  110. overflow: auto;
  111. }
  112. .item{
  113. flex: none;
  114. box-sizing: border-box;
  115. width: (320/40rem);
  116. height: (324/40rem);
  117. padding: 0 (22/40rem);
  118. background-color: #fff;
  119. box-shadow: 0 0 10px rgba(0,0,0,.3);
  120. border-radius: 5px;
  121. display: flex;
  122. flex-flow: column;
  123. justify-content: space-evenly;
  124. margin-right: (24/40rem);
  125. // 设置图片的宽度
  126. img{
  127. width: 100%;
  128. vertical-align: top;
  129. }
  130. // 课程标题
  131. .course-title{
  132. font-size: (32/48rem);
  133. color: #24253d;
  134. }
  135. // 设置用户信息的容器
  136. .user-info{
  137. display: flex;
  138. align-items: center;
  139. }
  140. // 头像
  141. .avatar{
  142. width: (42/40rem);
  143. height: (42/40rem);
  144. }
  145. // 用户的昵称
  146. .nickname{
  147. margin-left: 6px;
  148. font-size: (24/40rem);
  149. color: #969393;
  150. }
  151. }