0 Comments

学习笔记 剖析CSS缩写六大规则(2)

发布于:2013-08-21  |   作者:广州网站建设  |   已聚集:人围观

背景(Backgrounds)

背景的属性如下:


  1. background-color:#f00;  
  2. background-image:url(background.gif);  
  3. background-repeat:no-repeat;  
  4. background-attachment:fixed;  
  5. background-position:00;  
  6.  

可以缩写为一句:
广州网站建设,网站建设,广州网页设计,广州网站设计


  1. background:#f00url(background.gif)no-repeatfixed00;  
  2.  

语法是background:colorimagerepeatattachmentposition;

你可以省略其中一个或多个属性值,如果省略,该属性值将用浏览器默认值,默认值为: 


  1. color:transparent  
  2. image:none  
  3. repeat:repeat  
  4. attachment:scroll  
  5. position:0%0%  
  6.  

字体(fonts)

字体的属性如下: 


  1. font-style:italic;  
  2. font-variant:small-caps;  
  3. font-weight:bold;  
  4. font-size:1em;  
  5. line-height:140%;  
  6. font-family:"LucidaGrande",sans-serif;  
  7.  

可以缩写为一句:


  1. font:italicsmall-capsbold1em/140%"LucidaGrande",sans-serif;  
  2.  

注意,如果你缩写字体定义,至少要定义font-size和font-family两个值。
广州网站建设,网站建设,广州网页设计,广州网站设计

列表(lists)

取消默认的圆点和序号可以这样写list-style:none;

list的属性如下:


  1. list-style-type:square;  
  2. list-style-position:inside;  
  3. list-style-image:url(image.gif);  
  4.  

可以缩写为一句:


  1. list-style:squareinsideurl(image.gif);  
  2.  
标签:
飞机