header.css 2.7 KB

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