style常用样式

1.颜色:color
<style>
h2 {
color:red;
}
</style>

或:
<style>
.red-text {
color: red;
}
</style>
<h1 class="red-text">文本</h1>

2.字号:font-size
<style>
h1 {
font-size: 30px;
}
</style>

3.字体:font-family
<style>
h2 {
font-family: Sans-serif;
}
</style>

4.link标签来引入谷歌Lobster字体。
<link href="https://fonts.gdgdocs.org/css?family=Lobster" rel="stylesheet" type="text/css">
link标签解析:http://www.w3school.com.cn/tags/tag_link.asp

5.当某种字体不可用时,你可以让浏览器自动降级到另一种字体。
p {
font-family: Helvetica, Sans-Serif;
}
当 Helvetica不可用时,会降级使用Sans-Serif

一般浏览器都支持:Monospace、Serif和Sans-Serif字体.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容