您的位置: 域名 - 行业动态
« 上一篇下一篇 »

网站建设常用CSS缩写语法总结

分类: 行业动态 发布: zhushican 浏览: 日期: 2015-06-06

常用CSS缩写语法总结
The use of abbreviations may help to reduce your CSS file size, more easy to read. CSS abbreviation of the main rules are as follows:
Color
16 hex color value, if each of the two value is the same, can be abbreviated in half, for example:
#000000 can be abbreviated to #000; #336699 can be abbreviated to #369;
Box size
Usually has the following four kind of writing method:
Property:value1; all the edge is a value value1;
Property:value1 Value2; top and bottom values are value1, right and left value is Value2
Property:value1 Value2 value3; top value is value1, right and left values are Value2, bottom value is value3
Property:value1 Value2 value3 value4; four values are top, right, bottom, left
A convenient memory method is clockwise, right down left. Specific applications in margin and padding examples are as follows:
Margin:1em 0 2em 0.5em;
Frame ( border )
Frame properties are as follows:
Border-width:1px;
Border-style:solid;
Border-color:#000;
Can be abbreviated to a sentence: border:1px solid #000;
The grammar is border:width style color;
Background ( Backgrounds )
Background properties are as follows:
Background-color:#f00;
Background-image:url ( background.gif );
Background-repeat:no-repeat;
Background-attachment:fixed;
Background-position:0 0.
Can be abbreviated to one: background:#f00 URL ( background.gif ) no-repeat fixed 00;
Background:color image repeat attachment position grammar;
You can omit one or more attribute values, if omitted, the value of this attribute will use the browser default value, the default value for:
Color: transparent
Image: none
Repeat: repeat
Attachment: scroll
Position: 0% 0%
Font ( fonts )
Font properties are as follows:
Font-style:italic;
Font-variant:small-caps;
Font-weight:bold;
Font-size:1em;
Line-height:140%;
Can be abbreviated to a sentence: font:italic small-caps bold 1em/140% " Lucida Grande ", sans-serif;
Note, if your initials fonts defined, at least to the definition of font-size and font-family two values.
List ( lists )
Cancel default dot and serial number can be written in list-style:none;,
List properties are as follows:
List-style-type:square;
List-style-position:inside;
List-style-image:url ( image.gif );
Can be abbreviated to a sentence: list-style:square inside URL ( image.gif ) 

相关文章:

  • 评论:(0)
发表评论

Powered By qqq114.cn

Copyright 【10000个好做seo优化的域名】. Some Rights Reserved.