仔细学习CSS(二)

这样学习果然很浪费时间。但是我好像再也找不到其他方式可以系统过一下了。。

1. font

可继承的。

H1 {
  font-size: 36pt;
  font-family: serif;
  font-style: normal;/*italic*/
  font-weight: normal;/*bold*/
  font-variant: normal;
  line-height: normal;
}

2. margin & padding:外边距 & 内边距

就是由内而外:content->padding->border->margin。

margin:0 20px;// 上下0 左右20px

margin: 10px 20px 30px 40px;// 上、右、下、左

可以取的值:length、%(相比父节点的宽度内/外边距的长度)、auto(浏览器计算内/外边距)、inherit(从父节点继承内/外边距)(IE不支持inherit?)

3. links:a和它的伪类。

A:link, A:visited { text-decoration: none }
A:hover { background: cyan }
原文地址:https://www.cnblogs.com/hanyuxinting/p/4092926.html