一、常用Font属性的CSS缩写顺序
font-size设定文字大小 如:font-size: 12px;
line-height设定行距 如:line-height: 150%;
font-weight设定文字粗细 如:font-weight: bold;
font-style设定样式 如:font-style: italic;
font-variant 设定大小写 如: normal | small-caps;
font-family设定字体 如:font-family : "Lucida Grande", Verdana, Lucida, Arial, Helvetica, 宋体;
color设定文字颜色(注意不是font-color) 如:color: red;
示例:
font: 1em/1.5em bold italic small-caps verdana,serif
使用这一简写方式,至少要指定 font-size 和 font-family 属性,其他的属性如:font-weight , font-style , font-varient,未指定将自动使用默认值。
Font: 字号/行距 宽度 样式 大小写 字体名称;
颜色需另行定义,不是在font中定义。而行距却是在font中定义,与字体大小用 / 分隔定义。
二、border属性的CSS缩写顺序
border : border-width border-style border-color;
border:宽度 样式 颜色;
示例:
border: 1px solid #999;
三、background属性的CSS缩写顺序
背景属性:背景颜色 背景图片 背景是否重复 背景时候随浏览器滚动 背景平位置 背景垂直位置
background : background-color || background-image || background-repeat || background-attachment || background-position
transparent 表示透明无颜色
none 表示没有设置背景图片
repeat 表示图片重复
scroll 表示背景图片随浏览器下拉而滚动
left 水平居左 X
center 垂直居中位置 Y