@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;
}
CSS标准化
最新推荐文章于 2024-03-16 00:15:00 发布
该文详细介绍了如何使用CSS来设置网页的字体样式,包括引入GoogleFonts的Karla和Spectral字体,定义不同级别的标题和正文的字体大小、行高及颜色。此外,还涵盖了通用样式如链接、列表和小号文本的处理方法。
摘要由CSDN通过智能技术生成