CSS标准化

该文详细介绍了如何使用CSS来设置网页的字体样式,包括引入GoogleFonts的Karla和Spectral字体,定义不同级别的标题和正文的字体大小、行高及颜色。此外,还涵盖了通用样式如链接、列表和小号文本的处理方法。
摘要由CSDN通过智能技术生成
@import url("https://fonts.googleapis.com/css?family=Karla:400|Spectral:400");
body {
  padding: 2rem 5rem;
}

*,
::after,
::before {
  box-sizing: border-box;
}

html {
  font-size: 100%;
} /*16px*/

:root {
  --headingFont: "Spectral", serif;
  --bodyFont: "Karla", sans-serif;
  --smallText: 0.7em;
}

body {
  background: white;
  font-family: var(--bodyFont);
  font-weight: 400;
  line-height: 1.75;
  color: #000000;
}

p {
  margin-bottom: 1.5rem;
  max-width: 40rem;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  margin-bottom: 1.38rem;
  font-family: var(--headingFont);
  font-weight: 400;
  line-height: 1.3;
  text-transform: capitalize;
}

h1 {
  font-size: 3.052rem;
}

h2 {
  font-size: 2.441rem;
}

h3 {
  font-size: 1.953rem;
}

h4 {
  font-size: 1.563rem;
}

h5 {
  font-size: 1.25rem;
}

small,
.text-small {
  font-size: var(--smallText);
}

a {
  text-decoration: none;
}
ul {
  list-style-type: none;
  padding: 0;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值