header.css 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. .header {
  2. padding: 0px 10px 0px 10px;
  3. display: flex;
  4. height: 60px;
  5. justify-content: space-between;
  6. align-items: center;
  7. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  8. }
  9. .logo {
  10. height: 42px;
  11. border: 1px solid #ddd;
  12. border-radius: 8px;
  13. }
  14. .header-left {
  15. display: flex;
  16. flex-direction: row;
  17. justify-content: space-around;
  18. align-items: center;
  19. }
  20. .header-right {
  21. display: flex;
  22. flex-direction: row;
  23. justify-content: space-around;
  24. align-items: center;
  25. }
  26. .header-right-btn {
  27. margin-left: 10px;
  28. text-decoration: none;
  29. color:black;
  30. padding: 10px;
  31. }
  32. .header-right-btn:hover {
  33. background-color: #e5e5e5;
  34. }
  35. .dropdown {
  36. position: relative;
  37. display: inline-block;
  38. z-index: 1000;
  39. }
  40. .dropdown-content {
  41. display: none;
  42. position: absolute;
  43. right: -30px;
  44. background-color: #f9f9f9;
  45. min-width: 160px;
  46. box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  47. z-index: 1;
  48. }
  49. .dropdown-content a {
  50. color: black;
  51. padding: 12px 16px;
  52. text-decoration: none;
  53. display: block;
  54. }
  55. .dropdown-content a.selected {
  56. background-color: #e5e5e5;
  57. }
  58. .dropdown-content a:hover {
  59. background-color: #f1f1f1;
  60. }
  61. .dropdown:hover .dropdown-content {
  62. display: block;
  63. }
  64. .dropdown:hover .dropbtn {
  65. background-color: #e5e5e5;
  66. }
  67. /******************首页的下拉样式****************/
  68. .dropdown-home-content {
  69. display: none;
  70. position: absolute;
  71. padding: 20px 0px 20px 0px;
  72. background-color: #2e3030;
  73. min-width: 160px;
  74. z-index: 1;
  75. border: 1px solid #ccc;
  76. border-radius: 8px;
  77. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  78. }
  79. .dropdown-home-content a {
  80. color: #c5c7c6;
  81. padding: 12px 16px;
  82. text-decoration: none;
  83. display: block;
  84. }
  85. .dropdown-home-content a.selected {
  86. color: #e0ffef;
  87. font-weight: bold;
  88. font-size: 18px;
  89. }
  90. .dropdown-home-content a:hover {
  91. background-color: #47494a;
  92. }
  93. .dropdown:hover .dropdown-home-content {
  94. display: block;
  95. }
  96. .divider {
  97. height: 1px; /* 设置高度为1像素 */
  98. background-color: #47494a; /* 设置背景颜色为黑色 */
  99. margin: 5px auto; /* 设置上下外边距 */
  100. width: 80%;
  101. }
  102. .copyright {
  103. color: #888888;
  104. font-size: 12px;
  105. padding-left: 16px;
  106. }
  107. /* 默认隐藏搜索框 */
  108. .search-container {
  109. display: none;
  110. }
  111. /* 当屏幕宽度大于768px时显示搜索框 */
  112. @media (min-width: 768px) {
  113. .search-container {
  114. display: block;
  115. max-width: 600px;
  116. min-width: 400px;
  117. margin: 0 auto;
  118. padding: 16px;
  119. }
  120. .search-box {
  121. display: flex;
  122. width: 100%;
  123. border-radius: 8px;
  124. overflow: hidden;
  125. }
  126. .search-box input[type="text"] {
  127. flex-grow: 1;
  128. padding: 8px;
  129. border: none;
  130. outline: none;
  131. background-color: #f6f6f6;
  132. }
  133. .search-box button {
  134. padding: 8px;
  135. cursor: pointer;
  136. background-color: #f6f6f6;
  137. border: none;
  138. border-radius: 0 4px 4px 0;
  139. transition: background-color 0.3s;
  140. }
  141. .search-box button:hover {
  142. background-color: lightblue;
  143. }
  144. }