body { background-color: #f2f2f2; overflow: hidden; /* 禁止滚动条 */ margin: 0; padding: 0; } /* 设置头部样式 */ .header { background-color: #333; color: #fff; height: 50px; padding: 10px; text-align: center; } /* 设置中间部分样式 */ .container { max-width: 100%; padding: 20px; box-sizing: border-box; /* 设置padding不影响宽度 */ } /* 设置底边样式 */ .footer { background-color: #333; color: #fff; height: 50px; padding: 10px; text-align: center; } #list { display: grid; justify-content: center; align-items: center; width: 100%; height: 78vh; color: #000000; transform: scale(2); } .grid-container { display: grid; justify-content: center; align-items: center; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; margin: 8px; } .grid-item { background-color: #f2f2f2; padding: 20px; text-align: center; font-size: 5px; cursor: pointer; transition: all 0.2s ease-in-out; } .grid-item:hover { transform: scale(1.1); box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); } .grid-item a { display: block; text-decoration: none; color: #333; } @media only screen and (max-width: 600px) { .container { padding: 10px; } #list { height: 84vh; transform: scale(1); } .grid-container { grid-template-columns: repeat(2, 1fr); } .grid-item { font-size: 16px; padding: 10px; } .grid-item:hover { transform: scale(1.1); box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); } }