header.css 2.9 KB

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