Html中引入css的四种方式
1、行内式
style=“XXX”写在标签中
<h1 style = "color: #000;">
2、内嵌式
把style标签写在head标签中
<style> h1{color: #000;} </style>
3、导入式
在style标签中使用@import=“css_File”
<style> @import"style.css" </style>
4、链接式
使用link标签和href=“css_File”
<link rel="stylesheet" href="style.css" type="" media=""/>
css的基本选择器
1、标签选择器:tagName{}
2、类别选择器:.className{}
3、ID选择器:#idName{}
4、通配符:*{}表示页面内的所以元素
css复合选择器(权限:直连>空格>逗号)
1、交集选择:中间没空格(基本选择器之间)
表示前后多个选择器都满足
2、并集选择:用逗号(",")隔开(基本选择器之间)
表示前后多个选择器满足其中一个
3、后代选择:用空格(" ")隔开(基本选择器之间)
表示前者中的后者
css中的优先级
style行内>#id样式>.class样式>tag样式