引入css的四种方式
本文转载于: 猿2048 网站 引入css的四种方式 1.内联式引用:直接用在标签上,但维护成本高 style='font-size:16px;color:#000000' 2.外部连接式引用:css代码与html代码分离,便于代码重复使用 < link href ="css/style.css" type ="text/css" rel ="stylesheet" /> style.css文件内容如右: .font{color:blue;font-size:12px;} 3.内部式引用:页面较为清晰,但不能被别的页面使用 < style type ='text/css' > .font { color : blue ; font-size : 12px ; } </ style > 4.外部导入式:可以在一个HTML文件中导入多个样式表。类似于外部链接式引用 在HTML文件中head标签中加入 < style type ='text/css' > @import url('./style/style.css'); </ style > 来源: https://my.oschina.net/u/4191619/blog/3099942