Skip to content

基础属性

css
html {
  /* 重置基本样式 */
  margin: 0;
  padding: 0;

  /* 字体设置 */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(14px, 2vw, 18px);
  /* 动态字体大小 */
  line-height: 1.6;
  color: #e4e4e4;

  /* 盒子模型 */
  box-sizing: border-box;

  /* 背景和最小高度 */
  background-color: #818181;
  min-height: 100dvh;

  /* 文字渲染优化 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* 文本对齐(可选) */
  text-align: left;

  /* 禁用文字选择(根据需求) */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;

  /* 标准属性名+正确取值 */

  scroll-behavior: smooth;
  /* 平滑滚动 */
}

/* 链接样式重置 */
a {
  text-decoration: none;
  color: inherit;
}

/* 列表样式重置 */
ul,
ol {
  list-style: none;
}

/* 图片设置 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 按钮重置 */
button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}