news.scss 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. /* scss中可以用mixin来扩展 */
  2. @mixin ellipsis($line: 1) {
  3. overflow: hidden;
  4. text-overflow: ellipsis;
  5. display: -webkit-box;
  6. -webkit-line-clamp: $line;
  7. -webkit-box-orient: vertical;
  8. }
  9. @media screen and (min-width: 768px) {
  10. .main {
  11. .container {
  12. &.news-list {
  13. .title {
  14. font-size: 34px;
  15. text-align: center;
  16. margin: 80px 0;
  17. }
  18. .new {
  19. display: block;
  20. -webkit-transition: all 0.4s;
  21. transition: all 0.4s;
  22. margin-bottom: 40px;
  23. .cover {
  24. width: 290px;
  25. height: 190px;
  26. img {
  27. display: block;
  28. width: 100%;
  29. height: 100%;
  30. }
  31. }
  32. &:hover {
  33. -webkit-box-shadow: 0 6px 30px rgba(6, 136, 210, 0.2);
  34. box-shadow: 0 6px 30px rgba(6, 136, 210, 0.2);
  35. .name {
  36. color: #0688d2;
  37. }
  38. }
  39. .content {
  40. width: 780px;
  41. margin-left: 49px;
  42. -webkit-box-sizing: border-box;
  43. box-sizing: border-box;
  44. padding: 32px 0;
  45. .name {
  46. font-size: 20px;
  47. -webkit-transition: all 0.4s;
  48. transition: all 0.4s;
  49. }
  50. .date {
  51. font-size: 16px;
  52. color: #999999;
  53. margin-top: 14px;
  54. }
  55. .line {
  56. width: 100%;
  57. height: 1px;
  58. background: #e8e8e8;
  59. margin: 18px 0;
  60. }
  61. .desc {
  62. font-size: 16px;
  63. color: #505050;
  64. }
  65. }
  66. }
  67. }
  68. .pagination {
  69. display: -webkit-box;
  70. display: -ms-flexbox;
  71. display: flex;
  72. -webkit-box-pack: center;
  73. -ms-flex-pack: center;
  74. justify-content: center;
  75. -webkit-box-align: center;
  76. -ms-flex-align: center;
  77. align-items: center;
  78. padding-top: 25px;
  79. li {
  80. background: #e8e8e8;
  81. margin: 0 8px;
  82. &.active {
  83. background: #0688d2;
  84. a {
  85. color: #fff;
  86. }
  87. }
  88. &.more {
  89. background: transparent !important;
  90. a {
  91. color: #505050 !important;
  92. min-width: unset !important;
  93. padding: 0 !important;
  94. }
  95. }
  96. &:hover {
  97. background: #0688d2;
  98. a {
  99. color: #fff;
  100. }
  101. }
  102. a {
  103. display: block;
  104. height: 32px;
  105. line-height: 32px;
  106. padding: 0 10px;
  107. font-size: 12px;
  108. color: #505050;
  109. min-width: 32px;
  110. -webkit-box-sizing: border-box;
  111. box-sizing: border-box;
  112. text-align: center;
  113. }
  114. }
  115. }
  116. }
  117. }
  118. .footer {
  119. margin-top: 40px;
  120. }
  121. }
  122. @media screen and (max-width: 768px) {
  123. .main {
  124. .container {
  125. &.news-list {
  126. padding: 0 0.32rem;
  127. .title {
  128. font-size: 0.34rem;
  129. text-align: center;
  130. margin-top: 1.2rem;
  131. }
  132. .new {
  133. display: block;
  134. margin: 0.4rem 0;
  135. .cover {
  136. width: 2.9rem;
  137. height: 1.9rem;
  138. img {
  139. display: block;
  140. width: 100%;
  141. height: 100%;
  142. }
  143. }
  144. .content {
  145. width: 3.96rem;
  146. height: 1.9rem;
  147. -webkit-box-sizing: border-box;
  148. box-sizing: border-box;
  149. padding: 0.24rem;
  150. border: 1px solid #e8e8e8;
  151. border-left: 0;
  152. .name {
  153. font-size: 0.3rem;
  154. @include ellipsis(1);
  155. }
  156. .date {
  157. font-size: 0.24rem;
  158. color: #999999;
  159. margin-top: 0.06rem;
  160. }
  161. .line {
  162. width: 100%;
  163. height: 0.01rem;
  164. background: #e8e8e8;
  165. margin: 0.16rem 0;
  166. }
  167. .desc {
  168. font-size: 0.24rem;
  169. color: #505050;
  170. @include ellipsis(1);
  171. }
  172. }
  173. }
  174. }
  175. .pagination {
  176. display: -webkit-box;
  177. display: -ms-flexbox;
  178. display: flex;
  179. -webkit-box-pack: center;
  180. -ms-flex-pack: center;
  181. justify-content: center;
  182. -webkit-box-align: center;
  183. -ms-flex-align: center;
  184. align-items: center;
  185. padding-top: 0.8rem;
  186. li {
  187. background: #e8e8e8;
  188. margin: 0 0.12rem;
  189. &.active {
  190. background: #0688d2;
  191. a {
  192. color: #fff;
  193. }
  194. }
  195. &.more {
  196. background: transparent !important;
  197. a {
  198. color: #505050 !important;
  199. min-width: unset !important;
  200. padding: 0 !important;
  201. }
  202. }
  203. &:hover {
  204. background: #0688d2;
  205. a {
  206. color: #fff;
  207. }
  208. }
  209. a {
  210. display: block;
  211. height: 0.56rem;
  212. line-height: 0.56rem;
  213. padding: 0 10px;
  214. font-size: 12px;
  215. color: #505050;
  216. min-width: 0.56rem;
  217. -webkit-box-sizing: border-box;
  218. box-sizing: border-box;
  219. text-align: center;
  220. }
  221. }
  222. }
  223. }
  224. }
  225. .footer {
  226. margin-top: 40px;
  227. }
  228. }