在CSS中有许多简写的样式,它们被广泛使用。简写最好按照如下顺序进行书写
font: font-style font-weight font-size/line-height font-family
font-style
italic//斜体
normal//正常字体(默认)
font-weight
一般填写数字
400 normal(默认值)
700 bold(默认值)
font-size
16px(默认值)
font-family
直接填写字体名称即可如 `MicroSoft Yahei`
如
div{
font: italic 700 14px/20px 'Microsoft Yahei';
}
注意 不需要的属性可以省略(取默认值),但是必须保留font-size和font-family属性,否则font属性将不会生效
background: background-color background-image background-repeat background-attachment background-position
背景颜色 背景图片 背景平铺 背景固定 背景图片位置
如
background: transparent url(images/male.png) no-repeat fixed center center;
同样的对于你不需要的属性可以省略不写
border: border-width border-style border-color
如
border: 1px solid red;
//表明是表头
//一行
姓名 //一个单元格
性别
电话
//非表头部分
李白
男
18681282718
小美
女
15228578292