1.内嵌方式
写在body中。
<body>
<!-- 内嵌方式 -->
<h2 style="color: green;text-decoration: underline;font-size: 18px" >css引入方式</h2>
<h2>元芳</h2>
<h2>李白</h2>
</body>
2.内置方式
写在head中
<head>
<title>css引入方式</title>
<!-- 内置方式 -->
<style type="text/css">
h2
{
color: green;
text-decoration: underline;
font-size: 18px
}
/*这里不能有style*/
3.外链方式
新建一个css的文档。在head中利用link标签链接。
</style>
<!-- 外链方式 -->
<link rel="stylesheet" type="text/css" href="css01.css">
</head>
4.属性设置
颜色设置(color):可用颜色的单词表示 red green blue等。也可用#后跟三组16进制数表示。
href就是表示链接到哪个地方。