news.scss 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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. width: 7.06rem;
  136. .cover {
  137. width: 2.9rem;
  138. height: 1.9rem;
  139. img {
  140. display: block;
  141. width: 100%;
  142. height: 100%;
  143. }
  144. }
  145. .content {
  146. width: 3.96rem;
  147. height: 1.9rem;
  148. -webkit-box-sizing: border-box;
  149. box-sizing: border-box;
  150. padding: 0.24rem;
  151. border: 1px solid #e8e8e8;
  152. border-left: 0;
  153. .name {
  154. font-size: 0.3rem;
  155. @include ellipsis(1);
  156. }
  157. .date {
  158. font-size: 0.24rem;
  159. color: #999999;
  160. margin-top: 0.06rem;
  161. }
  162. .line {
  163. width: 100%;
  164. height: 0.01rem;
  165. background: #e8e8e8;
  166. margin: 0.16rem 0;
  167. }
  168. .desc {
  169. font-size: 0.24rem;
  170. color: #505050;
  171. @include ellipsis(1);
  172. }
  173. }
  174. }
  175. }
  176. .pagination {
  177. display: -webkit-box;
  178. display: -ms-flexbox;
  179. display: flex;
  180. -webkit-box-pack: center;
  181. -ms-flex-pack: center;
  182. justify-content: center;
  183. -webkit-box-align: center;
  184. -ms-flex-align: center;
  185. align-items: center;
  186. padding-top: 0.8rem;
  187. li {
  188. background: #e8e8e8;
  189. margin: 0 0.12rem;
  190. &.active {
  191. background: #0688d2;
  192. a {
  193. color: #fff;
  194. }
  195. }
  196. &.more {
  197. background: transparent !important;
  198. a {
  199. color: #505050 !important;
  200. min-width: unset !important;
  201. padding: 0 !important;
  202. }
  203. }
  204. &:hover {
  205. background: #0688d2;
  206. a {
  207. color: #fff;
  208. }
  209. }
  210. a {
  211. display: block;
  212. height: 0.56rem;
  213. line-height: 0.56rem;
  214. padding: 0 0.18rem;
  215. font-size: 0.2rem;
  216. color: #505050;
  217. min-width: 0.56rem;
  218. -webkit-box-sizing: border-box;
  219. box-sizing: border-box;
  220. text-align: center;
  221. }
  222. }
  223. }
  224. }
  225. }
  226. .footer {
  227. margin-top: 40px;
  228. }
  229. }