行内式是在标记的style属性中设定CSS样式。不推荐大规模使用。
<p style="color: red">Hello world.</p>
嵌入式是将CSS样式集中写在网页的
标签对的标签对中。格式如下:
<head>
<meta charset="UTF-8">
<title>Title</title>
<style type="text/css">
/*写我们的css代码*/
span{
color: yellow;
}
</style>
</head>
外部样式就是将css写在一个单独的文件中,然后在页面进行引入即可。推荐使用此方式。
<link href="mystyle.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
@import url('./index.css');
</style>
原文:https://www.cnblogs.com/randysun/p/11669058.html