同样,outline的简写中,outline-style也是必须的,另外两个值则可选,默认值和border相同。
背景(background) background是最常用的简写之一,它包含以下属性: background-color: color || #hex || RGB(% || 0-255) || RGBa; background-image:url(); background-repeat: repeat || repeat-x || repeat-y || no-repeat; background-position: X Y || (top||bottom||center) (left||right||center); background-attachment: scroll || fixed;
background的简写可以大大的提高css的效率:
background:#fff url(img.png) no-repeat 0 0;
background的简写也有些默认值:
background:transparent none repeat scroll top left ;
background属性的值不会继承,你可以只声明其中的一个,其它的值会被应用默认的。
font font简写也是使用最多的一个,它也是书写高效的CSS的方法之一。
font包含以下属性:
font-style: normal || italic || oblique; font-variant:normal || small-caps; font-weight: normal || bold || bolder || || lighter || (100-900); font-size: (number+unit) || (xx-small - xx-large); line-height: normal || (number+unit); font-family:name,"more names";
font的各个属性也都有默认值,记住这些默认值相对来说比较重要:
font-style: normal; font-variant:normal; font-weight: normal; font-size: inherit; line-height: normal; font-family:inherit;
(责任编辑:admin) |