Files
ClassContent/历届学生/font-end-nine/每天上课/2022-05-31/笔记.txt
2024-09-27 02:06:13 +08:00

108 lines
1.6 KiB
Plaintext
Raw 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.

css 层叠样式表 做美化
css 三种写法
内部写法 最高
内联写法
外链写法
写法顺序。在后面覆盖前面的
提升优先级:
!important
css 写法规则
选择器 {
css 属性名:css属性值;
css 属性名:css属性值;
css 属性名:css属性值;
}
选择器
标签选择器 清除css样式的时候用一下
类选择器 class .
id 选择器 #
默认口头约定,名字不能重复
通配符选择器 *
伪类选择器
hover
focus
选择多个
选择1, 选择器2 {
}
嵌套关系
选择1 选择器2 {
}
选择1同级最近的一个选择2
选择1 + 选择2 {
}
选中 选择1 里面最外层的选择器2
选择1>选择器2 {
}
相对路径
./ 当前路径
/ 根路径
../ 返回上一层
绝对路径
C:\Users\bmy\Desktop\fontendnine\每天上课\2022-05-31\index.css
盒子模型
具有宽高属性的标签
外边距 margin
内边距 padding
边框 border
内容
标准盒子模型
元素真实宽高 = 内容的宽高 + padding + border
怪异盒子模型(IE盒子模型)
box-sizing: border-box;
内容的宽高 = 元素真实宽高 - ( padding + border)
display:
none
inline 转化为行标签
block 转化为块标签
inline-block 转化为行内块标签 放一行