111
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

177 lines
3.2 KiB

3 years ago
  1. /* 修改containerd的宽度为1280,根据设计稿来走 */
  2. ul{
  3. list-style-type: none;
  4. padding: 0;
  5. margin: 0;
  6. }
  7. a{
  8. color: #666;
  9. text-decoration: none;
  10. }
  11. p{
  12. margin-bottom: 0;
  13. }
  14. body{
  15. background-color: #f5f5f5;
  16. }
  17. .container{
  18. background-color: #fff;
  19. }
  20. a:hover{
  21. text-decoration: none;
  22. }
  23. @media screen and (min-width: 1200px) {
  24. .container{
  25. width: 1280px;
  26. }
  27. }
  28. /* header */
  29. header{
  30. padding-left: 0!important;
  31. }
  32. .logo{
  33. background-color: rgb(85, 85, 228);
  34. }
  35. .logo img{
  36. display: block;
  37. width: 100%;
  38. /* 显示各种屏幕的适配方案 */
  39. /* logo图片不需要缩放 */
  40. max-width: 100%;
  41. margin: 0 auto;
  42. }
  43. /* 我们如果进入了我们的超小屏幕下,我们的图片就不要了 */
  44. /* 我们事先准备一个盒子在Logo里面他平时是隐藏的,只有在超小屏幕下显示 */
  45. .logo span{
  46. display: block;
  47. height: 50px;
  48. line-height: 50px;
  49. color: #ffffff;
  50. font-size: 18px;
  51. text-align: center;
  52. }
  53. .nav{
  54. background-color: #eee;
  55. border-bottom: 1px solid #eee;
  56. }
  57. .nav a{
  58. display: block;
  59. height: 50px;
  60. line-height: 50px;
  61. padding-left: 30px;
  62. font-size: 16px;
  63. }
  64. .nav a:hover{
  65. background-color: #fff;
  66. color: #333;
  67. }
  68. /* 当我们进入超小屏幕下的时候,我们NAV里面的LI浮动起来 ,并且宽度为20%*/
  69. @media screen and (max-width: 991px) {
  70. .nav li{
  71. float: left;
  72. width: 20%;
  73. }
  74. article{
  75. margin-top: 10px;
  76. }
  77. }
  78. /* 当我们进入超小屏幕下的时候,我们NAV里面的文字会变成12px */
  79. /* 当我们处于超小屏幕时,第一个Li宽度为100%,剩下的各个Li各占50% */
  80. @media screen and (max-width: 767px) {
  81. .nav li a{
  82. font-size: 14px;
  83. padding-left: 3px;
  84. }
  85. .news li:nth-child(1){
  86. width: 100%!important;
  87. }
  88. .news li{
  89. width: 50%!important;
  90. }
  91. .publish{
  92. font-size: 14px!important;
  93. }
  94. }
  95. .nav a::before{
  96. /* 图片与文字居中 */
  97. vertical-align: middle;
  98. padding-left: 5px;
  99. }
  100. .news li{
  101. float: left;
  102. width: 25%;
  103. height: 128px;
  104. padding-right: 10px;
  105. margin-bottom: 10px;
  106. }
  107. .news li:nth-child(1){
  108. width: 50%;
  109. height: 266px;
  110. /* background-color: pink; */
  111. }
  112. .news li:nth-child(1) p{
  113. line-height: 40px;
  114. font-size: 16px;
  115. padding: 0 10px;
  116. }
  117. .news li a{
  118. position: relative;
  119. display: block;
  120. width: 100%;
  121. height: 100%;
  122. }
  123. .news li a img{
  124. width: 100%;
  125. height: 100%;
  126. }
  127. .news li a p{
  128. position: absolute;
  129. bottom: 0;
  130. left: 0;
  131. width: 100%;
  132. height: 40px;
  133. background: rgba(0,0,0,0.5);
  134. font-size: 12px;
  135. color: #fff;
  136. padding: 5px 10px;
  137. }
  138. .publish{
  139. border-top: 1px solid #ccc;
  140. }
  141. .pic{
  142. margin-top: 10px;
  143. width: 22%;
  144. height: 130px;
  145. background-color: pink;
  146. padding: 0;
  147. }
  148. .pic img{
  149. width: 100%;
  150. height: 100%;
  151. }
  152. .publish .row{
  153. border-bottom: 1px solid #ccc;
  154. padding: 10px 0;
  155. }
  156. .banner,
  157. .banner img
  158. {
  159. width: 100%;
  160. }
  161. .hot{
  162. display: block;
  163. margin-top: 20px;
  164. border: 1px solid #ccc;
  165. padding: 0 20px 20px;
  166. }
  167. .hot span{
  168. border-radius: 0;
  169. margin-bottom: 20px;
  170. }
  171. .hot p{
  172. font-size: 12px;
  173. }