如何创建边框阴影插入

时间:2013-07-03 22:04:36

标签: css css3 photoshop

enter image description here

如何创建边框阴影插入,如上图所示

jsfiddle

<div id="progress-bar">
  <div id="bar"></div>                        
</div>

#progress-bar {
    margin-top: 50px;
    margin-bottom: 100px;
}

#bar {
    width: 97%;
    height: 20px;
    background-color: #eeebf1;
    border-radius: 9px;
    -moz-border-radius: 9px;
    -webkit-border-radius: 9px;

}

2 个答案:

答案 0 :(得分:3)

您可以使用css box-shadow属性:Box Shadow

#bar {
width: 97%;
height: 20px;
background-color: #eeebf1;
border-radius: 9px;
-moz-border-radius: 9px;
-webkit-border-radius: 9px;
    -moz-box-shadow:    3px 3px 3px #CCC inset;
    -webkit-box-shadow: 3px 3px 3px #CCC inset;
    box-shadow: 3px 3px 3px #CCC inset;
}

http://jsfiddle.net/8kbwd/2/

答案 1 :(得分:1)

试一试......

.shadow {
   -moz-box-shadow-top:    inset 0 0 10px #000000;
   -webkit-box-shadow-top: inset 0 0 10px #000000;
   box-shadow-top:         inset 0 0 10px #000000;
}