Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1827955
  • 博文数量: 438
  • 博客积分: 9799
  • 博客等级: 中将
  • 技术积分: 6092
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-25 17:25
文章分类

全部博文(438)

文章存档

2019年(1)

2013年(8)

2012年(429)

分类: 系统运维

2012-05-14 00:40:21

Border

PropertyDescriptionCSS
border-imageA shorthand property for setting all the border-image-* properties3
border-radiusA shorthand property for setting all the four border-*-radius properties3
box-shadowAttaches one or more drop-shadows to the box3


Background

PropertyDescriptionCSS
background-clipSpecifies the painting area of the background images3
background-originSpecifies the positioning area of the background images3
background-sizeSpecifies the size of the background images3

文字效果

PropertyDescriptionCSS
hanging-punctuationSpecifies whether a punctuation character may be placed outside the line box3
punctuation-trimSpecifies whether a punctuation character should be trimmed3
text-align-lastDescribes how the last line of a block or a line right before a forced line break is aligned when text-align is "justify"3
text-emphasisApplies emphasis marks, and the foreground color of the emphasis marks, to the element's text3
text-justifySpecifies the justification method used when text-align is "justify"3
text-outlineSpecifies a text outline3
text-overflowSpecifies what should happen when text overflows the containing element3
text-shadowAdds shadow to text3
text-wrapSpecifies line breaking rules for text3
word-breakSpecifies line breaking rules for non-CJK scripts3
word-wrapAllows long, unbreakable words to be broken and wrap to the next line3


字体

CSS3之前网页只能使用安装在本地的字体,在CSS3通过@font-face可以使用任何字体。


@font-face的属性有:

DescriptorValuesDescription
font-familynameRequired. Defines a name for the font
srcURLRequired. Defines the URL of the font file
font-stretchnormal
condensed
ultra-condensed
extra-condensed
semi-condensed
expanded
semi-expanded
extra-expanded
ultra-expanded
Optional. Defines how the font should be stretched. Default is "normal"
font-stylenormal
italic
oblique
Optional. Defines how the font should be styled. Default is "normal"
font-weightnormal
bold
100
200
300
400
500
600
700
800
900
Optional. Defines the boldness of the font. Default is "normal"
unicode-rangeunicode-rangeOptional. Defines the range of UNICODE characters the font supports. Default is "U+0-10FFFF"


2D Transforms

CSS3引入了新的Transforms属性,可以对图形进行变换。
PropertyDescriptionCSS
transformApplies a 2D or 3D transformation to an element3
transform-originAllows you to change the position on transformed elements3


该属性需要浏览器的前缀:
IE 9: -ms-
Safari/Chrome: -webkit- 
Opera: -o-
Firefox: -moz-

例:
div
{
  transform: scale(2,4);
  -ms-transform: scale(2,4); /* IE 9 */
  -webkit-transform: scale(2,4); /* Safari and Chrome */
  -o-transform: scale(2,4); /* Opera */
  -moz-transform: scale(2,4); /* Firefox */
}

支持的函数有:

FunctionDescription
matrix(n,n,n,n,n,n)Defines a 2D transformation, using a matrix of six values
translate(x,y)Defines a 2D translation, moving the element along the X- and the Y-axis
translateX(n)Defines a 2D translation, moving the element along the X-axis
translateY(n)Defines a 2D translation, moving the element along the Y-axis
scale(x,y)Defines a 2D scale transformation, changing the elements width and height
scaleX(n)Defines a 2D scale transformation, changing the element's width
scaleY(n)Defines a 2D scale transformation, changing the element's height
rotate(angle)Defines a 2D rotation, the angle is specified in the parameter
skew(x-angle,y-angle)Defines a 2D skew transformation along the X- and the Y-axis
skewX(angle)Defines a 2D skew transformation along the X-axis
skewY(angle)Defines a 2D skew transformation along the Y-axis


3D Transforms

PropertyDescriptionCSS
transformApplies a 2D or 3D transformation to an element3
transform-originAllows you to change the position on transformed elements3
transform-styleSpecifies how nested elements are rendered in 3D space3
perspectiveSpecifies the perspective on how 3D elements are viewed3
perspective-originSpecifies the bottom position of 3D elements3
backface-visibilityDefines whether or not an element should be visible when not facing the screen3

FunctionDescription
matrix3d
(n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n)
Defines a 3D transformation, using a 4x4 matrix of 16 values
translate3d(x,y,z)Defines a 3D translation
translateX(x)Defines a 3D translation, using only the value for the X-axis
translateY(y)Defines a 3D translation, using only the value for the Y-axis
translateZ(z)Defines a 3D translation, using only the value for the Z-axis
scale3d(x,y,z)Defines a 3D scale transformation
scaleX(x)Defines a 3D scale transformation by giving a value for the X-axis
scaleY(y)Defines a 3D scale transformation by giving a value for the Y-axis
scaleZ(z)Defines a 3D scale transformation by giving a value for the Z-axis
rotate3d(x,y,z,angle)Defines a 3D rotation
rotateX(angle)Defines a 3D rotation along the X-axis
rotateY(angle)Defines a 3D rotation along the Y-axis
rotateZ(angle)Defines a 3D rotation along the Z-axis
perspective(n)Defines a perspective view for a 3D transformed element


Transitions

CSS3可以不使用Flash动画或JavaScripts就可以动态改变样式。

例如:
div
{
  transition-property: width;
  transition-duration: 1s;
  transition-timing-function: linear;
  transition-delay: 2s;

  /* Firefox 4 */
  -moz-transition-property:width;
  -moz-transition-duration:1s;
  -moz-transition-timing-function:linear;
  -moz-transition-delay:2s;

  /* Safari and Chrome */
  -webkit-transition-property:width;
  -webkit-transition-duration:1s;
  -webkit-transition-timing-function:linear;
  -webkit-transition-delay:2s;

  /* Opera */
  -o-transition-property:width;
  -o-transition-duration:1s;
  -o-transition-timing-function:linear;
  -o-transition-delay:2s;
}

div:hover
{
  width:200px;
}

PropertyDescriptionCSS
transitionA shorthand property for setting the four transition properties into a single property3
transition-propertySpecifies the name of the CSS property to which the transition is applied3
transition-durationDefines the length of time that a transition takes. Default 03
transition-timing-functionDescribes how the speed during a transition will be calculated. Default "ease"3
transition-delayDefines when the transition will start. Default 03


Animations

CSS3可以定义动画,例如:

div
{
  width:100px;
  height:100px;
  background:red;
  position:relative;
  animation:myfirst 5s;
  -moz-animation:myfirst 5s; /* Firefox */
  -webkit-animation:myfirst 5s; /* Safari and Chrome */
}


@keyframes myfirst
{
  0%   {background:red; left:0px; top:0px;}
  25%  {background:yellow; left:200px; top:0px;}
  50%  {background:blue; left:200px; top:200px;}
  75%  {background:green; left:0px; top:200px;}
  100% {background:red; left:0px; top:0px;}
}


@-moz-keyframes myfirst /* Firefox */
{
  0%   {background:red; left:0px; top:0px;}
  25%  {background:yellow; left:200px; top:0px;}
  50%  {background:blue; left:200px; top:200px;}
  75%  {background:green; left:0px; top:200px;}
  100% {background:red; left:0px; top:0px;}
}


@-webkit-keyframes myfirst /* Safari and Chrome */
{
  0%   {background:red; left:0px; top:0px;}
  25%  {background:yellow; left:200px; top:0px;}
  50%  {background:blue; left:200px; top:200px;}
  75%  {background:green; left:0px; top:200px;}
  100% {background:red; left:0px; top:0px;}
}

PropertyDescriptionCSS
@keyframesSpecifies the animation3
animationA shorthand property for all the the animation properties, except the animation-play-state property3
animation-nameSpecifies the name of the @keyframes animation3
animation-durationSpecifies how many seconds or milliseconds an animation takes to complete one cycle. Default 03
animation-timing-functionDescribes how the animation will progress over one cycle of its duration. Default "ease"3
animation-delaySpecifies when the animation will start. Default 03
animation-iteration-countSpecifies the number of times an animation is played. Default 13
animation-directionSpecifies whether or not the animation should play in reverse on alternate cycles. Default "normal"3
animation-play-stateSpecifies whether the animation is running or paused. Default "running"3


Multiple Columns

CSS3可以把一个元素分成多列显示,例如:

.newspaper
{
-moz-column-count:3; /* Firefox */
-webkit-column-count:3; /* Safari and Chrome */
column-count:3;


-moz-column-gap:40px; /* Firefox */
-webkit-column-gap:40px; /* Safari and Chrome */
column-gap:40px;


-moz-column-rule:4px outset #ff00ff; /* Firefox */
-webkit-column-rule:4px outset #ff00ff; /* Safari and Chrome */
column-rule:4px outset #ff00ff;
}

PropertyDescriptionCSS
column-countSpecifies the number of columns an element should be divided into3
column-fillSpecifies how to fill columns3
column-gapSpecifies the gap between the columns3
column-ruleA shorthand property for setting all the column-rule-* properties3
column-rule-colorSpecifies the color of the rule between columns3
column-rule-styleSpecifies the style of the rule between columns3
column-rule-widthSpecifies the width of the rule between columns3
column-spanSpecifies how many columns an element should span across3
column-widthSpecifies the width of the columns3
columnsA shorthand property for setting column-width and column-count3


User Interface

CSS3支持新的UI属性,比如:

  • resize
  • box-sizing
  • outline-offset
PropertyDescriptionCSS
appearanceAllows you to make an element look like a standard user interface element3
box-sizingAllows you to define certain elements to fit an area in a certain way3
iconProvides the author the ability to style an element with an iconic equivalent3
nav-downSpecifies where to navigate when using the arrow-down navigation key3
nav-indexSpecifies the tabbing order for an element3
nav-leftSpecifies where to navigate when using the arrow-left navigation key3
nav-rightSpecifies where to navigate when using the arrow-right navigation key3
nav-upSpecifies where to navigate when using the arrow-up navigation key3
outline-offsetOffsets an outline, and draws it beyond the border edge3
resizeSpecifies whether or not an element is resizable by the user3


CSS引用
阅读(1310) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~