styles.css 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /* 基本样式 */
  2. body {
  3. font-family: Arial, sans-serif;
  4. margin: 0;
  5. padding: 0;
  6. background-color: #f4f4f4;
  7. }
  8. /* 表单容器 */
  9. .form-container {
  10. width: 90%;
  11. margin: 0 auto;
  12. padding: 20px;
  13. background-color: #ffffff;
  14. box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
  15. }
  16. /* 表单行,使用 flexbox 布局 */
  17. .form-row {
  18. display: flex;
  19. justify-content: space-between;
  20. /* 水平分配空间 */
  21. margin-bottom: 20px;
  22. flex-wrap: wrap;
  23. /* 如果窗口过小,允许换行 */
  24. }
  25. /* 每个查询条件的容器 */
  26. .form-group {
  27. display: flex;
  28. align-items: center;
  29. /* 垂直居中 */
  30. flex: 0 0 30%;
  31. /* 每个查询条件占宽度的 30%,留出空隙 */
  32. }
  33. /* 标签 */
  34. label {
  35. display: inline-block;
  36. width: 100px;
  37. /* 固定标签宽度 */
  38. font-weight: bold;
  39. text-align: right;
  40. margin-right: 10px;
  41. /* 标签与输入框之间的距离 */
  42. white-space: nowrap;
  43. /* 防止标签换行 */
  44. }
  45. /* 输入框和下拉框样式 */
  46. input,
  47. select {
  48. padding: 8px;
  49. width: 100%;
  50. /* 输入框宽度占满剩余空间 */
  51. box-sizing: border-box;
  52. }
  53. /* 提交按钮 */
  54. button {
  55. padding: 12px 20px;
  56. background-color: #4CAF50;
  57. color: white;
  58. border: none;
  59. cursor: pointer;
  60. width: 100%;
  61. font-size: 16px;
  62. }
  63. button:hover {
  64. background-color: #45a049;
  65. }
  66. /* 每行之间的间距 */
  67. .form-row+.form-row {
  68. margin-top: 10px;
  69. }
  70. /* 样式调整,保证响应式 */
  71. @media (max-width: 768px) {
  72. .form-group {
  73. flex: 0 0 100%;
  74. /* 在小屏幕上,每个查询条件占满整行 */
  75. margin-bottom: 10px;
  76. }
  77. label {
  78. width: 80px;
  79. }
  80. }