css3 ------ box-shadow

语法<shadow> = inset? && <length>{2,4} && <color>?    

注释:问号表示可选参数;{2,4}表示最少2个参数最多4个;
当length = 2时,代表position x 和position y的值;
当length = 3时,代表position x, position y, blur;
当length = 4时,代表position x, position y, blur, spread;

example: 

当length = 2时:

 
css3 ------ box-shadow
element {
  width: 300px;    
  height: 192px;
  background-color: #C14343;
  position: relative;
  box-shadow: 18px 14px 0px 0px #914E60;
}
css3 ------ box-shadow

当length = 3时:

 
css3 ------ box-shadow
element {
  width: 300px;    
  height: 192px;
  background-color: #C14343;
  position: relative;
  box-shadow: 18px 14px 5px 0px #914E60;
}
css3 ------ box-shadow

当length = 4时:

 
css3 ------ box-shadow
element {
  width: 300px;    
  height: 192px;
  background-color: #C14343;
  position: relative;
  box-shadow: 18px 14px 5px 8px #914E60;
}
css3 ------ box-shadow

当使用inset属性时:

 
 
css3 ------ box-shadow
element{
  border:5px solid blue;
  border-radius: 20px;
  background-color:orange;
  width: 144px;
  height: 144px;
  box-shadow: rgba(0,0,0,0.4) 10px 10px inset;
}
css3 ------ box-shadow

浏览器的支持:

box-shadow  // ie, firefox, chrome, opera
-webkit-box-shadow //chrome, opera
-moz-box-shadow //都不支持

推荐box-shadow   generator:  https://developer.mozilla.org/en-US/docs/Web/CSS/Tools/Box-shadow_generator
参考文献:http://www.w3.org/TR/css3-background/










css3 ------ box-shadow,布布扣,bubuko.com

css3 ------ box-shadow

上一篇:记一次subNVue 原生子窗体的使用


下一篇:jquery.validate动态更改校验规则