Tips About Css
usage of calc()
- for the content in calc, especially for operator + -, we need to keep space before or after them. otherwise, they will not be regonized by browser.
*{
width:calc(2.1% + 40px);
}
usage of Line-height
line-height:2, image we have a single line in the middle of the text we target. 2/2=1Xown-font-sizespace will be above, and same below. So, if we don't specify
the height of the element, the text will always be vertical center, if we spedify it, we can keep the line-height same to the height to keep content vertical center.