Text
VS Code Tips
在VS Code里,比如输入div.test回车或则Tab自动变成 <div class="test"></div>
0 notes
Text
Relative units 相对单位
%: width or height相对于你的parent element的width or height
vw:viewport width
vh: viewport height
0 notes
Text
CSS Width & Height
除了可以设置px, 可以设置vw和vh
比如下图,width和height随着浏览器view而变化
0 notes
Text
CSS Pading
一般情况直接写padding
四个值:padding(上 右 下 左) 顺时针
两个值:padding(上下 左右)
一个值: padding(上下左右)
0 notes
Text
CSS Box Model
Box含有
Content 内容
Padding 内部距离
Border 外框
Margin 外部距离
All html elements are boxes with width and height
Box含有的六个属性
0 notes
Text
Background size and position
https://developer.mozilla.org/zh-CN/docs/Web/CSS/background-size
background可以代表image或者color,看里面的参数
0 notes
Text
Font-family 用法
font-family: 'Courier New', Courier, monospace;
假如没有第一个,就第二个,如此类推
https://www.w3schools.com/cssref/css_fonts_fallbacks.asp
font-weight 字体粗细,比如默认400
text-indent:32px; Text前面留白
0 notes
Text
Text align and decoration
text-decoration常用
underline,none,line-through
0 notes
Text
CSS Rules 规则总结
1. Cascade 阶层
有两个CSS的Selector有相同特定度时使用
2. Specificity 特定度
3. Inheritance 继承
Inherited from parent
Non-inherited by default
假如原本就有default就不会继承,没有的话才会继承parent
inline styling > id > class > element selector > inheritance
0 notes