Files
2024-09-27 02:06:13 +08:00

44 lines
893 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

1css: 层叠样式表
2写法
1内联写法就是讲css代码写在html标签内部
<h2 style="color:red">你好</h2>
2内部写法将代码放在head里面和html代码脱离
<style>
h2 {
coloe:red;
}
</style>
选择器 {
属性名: 属性值;
}
3外部(外链)写法
<link rel="stylesheet" href="./index.css">
权重(优先应用css代码的等级)1 > 2 > 3
想改变默认的规则: !important
3选择器学习
class(类选择器 “ . ”): 可以无限重复
id(" # "): 用id选择器的元素是全局唯一存在的不要出现重复
标签选择器:
* 通配符选择器 用途:清除浏览器默认样式
+ 选择莫个元素之后的同级元素
> 选中莫个父元素里面的子元素
, 同时选中多个元素
a 空格 b 选中莫个父元素里面的子元素