如何制作背景css 3D?

时间:2015-01-13 07:22:10

标签: css

我想在下面制作背景图片:

https://www.dropbox.com/s/o25l81jc0ph889y/Untitled.png?dl=0

这是我的css,但它不像我期望的结果。

background: #5BA8E8;
background-image: -webkit-linear-gradient(top, #428bca, #428bca);
background-image: -moz-linear-gradient(top, #5BA8E8, #5BA8E8);
background-image: -ms-linear-gradient(top, #5BA8E8, #5BA8E8);
background-image: -o-linear-gradient(top, #5BA8E8, #5BA8E8);
background-image: linear-gradient(to bottom, #5BA8E8, #5BA8E8);
box-shadow: 1px 1px 1px 1px #5BA8E8;
border: 1px solid #5BA8E8;

1 个答案:

答案 0 :(得分:1)

这是一个例子

<div class="button-wrapper">                 
    <a href="#" class="a-btn">                                                     
    <span class="a-btn-text"></span> 
    <span class="a-btn-icon-right"><span></span></span>
   </a>
</div>  

和CSS

.button-wrapper {
    margin: 0 auto;
    padding: 20px 0;
    width: 320px;
    clear: both;
}

.button-wrapper a {
    color: #FFFFFF;
    text-decoration: none;
    font-family: 'Oswald',Arial,sans-serif; 
}

.a-btn{
    background:#a9db80;
    background:-webkit-gradient(linear,left top,left bottom,color-stop(#a9db80,0),color-stop(#96c56f,1));
    background:-webkit-linear-gradient(top, #a9db80 0%, #96c56f 100%);
    background:-moz-linear-gradient(top, #a9db80 0%, #96c56f 100%);
    background:-o-linear-gradient(top, #a9db80 0%, #96c56f 100%);
    background:linear-gradient(top, #a9db80 0%, #96c56f 100%);
    filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#a9db80', endColorstr='#96c56f',GradientType=0 );
    padding-left:90px;
    padding-right:105px;
    height:90px;
    display:inline-block;
    position:relative;
    border:1px solid #80ab5d;
    -webkit-box-shadow:0px 1px 1px rgba(255,255,255,0.8) inset, 1px 1px 3px rgba(0,0,0,0.2);
    -moz-box-shadow:0px 1px 1px rgba(255,255,255,0.8) inset, 1px 1px 3px rgba(0,0,0,0.2);
    box-shadow:0px 1px 1px rgba(255,255,255,0.8) inset, 1px 1px 3px rgba(0,0,0,0.2);
    -webkit-border-radius:4px;
    -moz-border-radius:4px;
    border-radius:4px;
    float:left;
    clear:both;
    margin:10px 0px;
    overflow:hidden;
    -webkit-transition:box-shadow 0.3s ease-in-out;
    -moz-transition:box-shadow 0.3s ease-in-out;
    -o-transition:box-shadow 0.3s ease-in-out;
    transition:box-shadow 0.3s ease-in-out;

}

.a-btn-text{
    padding-top:21px;
    padding-left: 5px;
    display:block;
    font-size:30px;
    text-shadow:0px -1px 1px #80ab5d;
}

.a-btn-icon-right{
    position:absolute;
    right:0px;
    top:0px;
    height:100%;
    width:80px;
    border-left:1px solid #80ab5d;
    -webkit-box-shadow:1px 0px 1px rgba(255,255,255,0.4) inset;
    -moz-box-shadow:1px 0px 1px rgba(255,255,255,0.4) inset;
    box-shadow:1px 0px 1px rgba(255,255,255,0.4) inset;
}

你可以看到对小提琴的影响: http://jsfiddle.net/7c28g3z9/