2025-02-19 13:42:56 +08:00

52 lines
1.1 KiB
CSS

/* 现代 CSS 重置方案(推荐最佳实践) */
*,
*::before,
*::after {
box-sizing: border-box; /* 1. 使用更直观的盒模型 */
margin: 0; /* 2. 清除默认外边距 */
padding: 0; /* 3. 清除默认内边距 */
}
html {
scroll-behavior: smooth; /* 4. 平滑滚动 */
-webkit-text-size-adjust: 100%; /* 5. 防止字体缩放 */
-webkit-font-smoothing: antialiased; /* 6. 字体抗锯齿 */
}
body {
min-height: 100vh;
line-height: 1.5;
text-rendering: optimizeSpeed; /* 7. 优化文本渲染 */
}
ul[role="list"],
ol[role="list"] {
list-style: none; /* 8. 清除列表样式(保留语义) */
}
a:not([class]) {
text-decoration-skip-ink: auto; /* 9. 链接下划线优化 */
}
img {
max-width: 100%;
display: block; /* 10. 消除图片底部间隙 */
}
button,
input,
select,
textarea {
font: inherit; /* 11. 表单元素字体继承 */
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}