插入样式表的方法有三种:
外部样式表(External style sheet):<link rel="stylesheet" href="demo.css">
内部样式表(Internal style sheet):<style></style>
内联样式(Inline style):<p style="color:yellow;"></p>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="demo.css"/>
<style type="text/css">
h3{color:green;}
</style>
</head>
<body>
<h3>测试!</h3>
</body>
</html>
优先级:
<head>
<link rel="stylesheet" type="text/css" href="style.css"/>
<style type="text/css">
h3{color:green;}
</style>
</head>
<body>
<h3>测试!</h3>
</body>