建站学 - 轻松建站从此开始!

建站学-个人建站指南,网页制作,网站设计,网站制作教程

当前位置: 建站学 > 网页设计 > css教程 >

CSS属性的缩写(2)

时间:2011-03-07 08:29来源: 作者: 点击:
同样,outline的简写中,outline-style也是必须的,另外两个值则可选,默认值和border相同。 背景(background) background是最常用的简写之一,它包含以下属性: background-color: color || #hex || RGB(% || 0-25

同样,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)

织梦二维码生成器
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片