01 css语法规则
什么是css ? 层叠样式表
1.行内样式(内联写法) 1000
<img style='color:red;'>
2.内部样式
style标签
<style> img{ width:100px ; height:100px; .... } </style>
3.外部样式写法 link标签引入-->
<link rel="stylesheet" href="./01.css">
02 css注释
/* css的注释方式 */ /* ctrl+/ */
03 css选择器权重,优先级,组合选择器
选择器:
语法规则:(属性名:属性值) 优先级:!important > 行内样式(10000) > id选择器(1000)#>class选择器 (100).>标签选择器(10)>通配符选择器(0)>!important 写法:width: 600px !important; 行内样式: style="width: 100px;" id选择器 :先给标签设置id 然后在style标签里面 通过#+id名获取标签
#img{ width: 600px !important; }
class选择器