你能想到哪些好的css速记?

你能想到哪些好的css速记?,css,forms,stylesheet,short,shorthand,Css,Forms,Stylesheet,Short,Shorthand,我能想到的一些是 字体:粗体20px Verdana,无衬线/*一行表示变体、大小和系列*/ 颜色:#336/*短颜色代码*/ 高度:0/*0时无需指定单位*/ 边框:0/*与边框效果相同:无,但更短*/ 背景:#ffc/*如果只需要颜色,则无需使用背景色*/ 填充:0;边界:0;边距:0/*仅显示内容,不显示其他内容*/ 边框:1px虚线#ff0/*厚度、样式和颜色*/ 边距:0.5em/*指定上、下、左、右边距*/ 1. background: #fff url(image.png) no

我能想到的一些是

字体:粗体20px Verdana,无衬线/*一行表示变体、大小和系列*/

颜色:#336/*短颜色代码*/

高度:0/*0时无需指定单位*/

边框:0/*与边框效果相同:无,但更短*/

背景:#ffc/*如果只需要颜色,则无需使用背景色*/

填充:0;边界:0;边距:0/*仅显示内容,不显示其他内容*/

边框:1px虚线#ff0/*厚度、样式和颜色*/

边距:0.5em/*指定上、下、左、右边距*/

 1. background: #fff url(image.png) no-repeat 20px 100px fixed;
 2. ul { list-style: decimal-leading-zero inside; }
逗号分隔的声明

 1. .footer em:first-child { color:#ccc; }
  • h1、h2、h3、h4、h5、h6{字体系列:Helvetica、Verdana、sans serif;}
  • 第一个子选择器

     1. .footer em:first-child { color:#ccc; }
    
    CSS3功能

     1. .footer em:first-child { color:#ccc; }
    
    带半径的圆形框

     1. .footer em:first-child { color:#ccc; }
    
  • 圆角{-moz边框半径:10px;-webkit边框半径:10px;宽度:400px;高度:100px;背景色:#000;}
  • 阴影效果

    .shadow{宽度:400px;高度:200px;背景色:#000;-webkit盒阴影:5px 5px 2px#ccc;}

    逗号分隔的声明

     1. .footer em:first-child { color:#ccc; }
    
  • h1、h2、h3、h4、h5、h6{字体系列:Helvetica、Verdana、sans serif;}
  • 第一个子选择器

     1. .footer em:first-child { color:#ccc; }
    
    CSS3功能

     1. .footer em:first-child { color:#ccc; }
    
    带半径的圆形框

     1. .footer em:first-child { color:#ccc; }
    
  • 圆角{-moz边框半径:10px;-webkit边框半径:10px;宽度:400px;高度:100px;背景色:#000;}
  • 阴影效果


    .shadow{width:400px;height:200px;background color:#000;-webkit box shadow:5px 5px 2px#ccc;}

    您还可以使用font属性指定行高

    font: bold 20px/1em Verdana, sans-serif /* one line for variant, size, and family */
    

    其中1em是行高

    您还可以使用font属性指定行高

    font: bold 20px/1em Verdana, sans-serif /* one line for variant, size, and family */
    
    其中1em是线条高度

    轮廓的另一个:

    outline:3px dotted gray;
    
    列表样式也支持图像:

    list-style:square inside url(image.gif);
    
    有点多余,但这里有另一篇文章解释它们:

    大纲是另一个:

    outline:3px dotted gray;
    
    列表样式也支持图像:

    list-style:square inside url(image.gif);
    
    有点多余,但这里有另一篇文章解释它们:


    速记可以很好,但请注意,即使您没有指定它们,它们也会覆盖所有适用的属性。例如:“border:solid 1px”也会重置“border color”,即使您没有提到它。Dustin Diaz有。速记可以很好,但请注意,即使您没有指定它们,它们也会覆盖所有适用的属性。例如:“border:solid 1px”也会重置“border color”,即使您没有提到它。Dustin Diaz有.Neat的东西,但只有前两个是速记。background是我最喜欢的,所以我支持它Neat的东西,但只有前两个是速记。background是我最喜欢的,所以我支持它