header.css 2.7 KB

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