css 背景漸層,圓角,陰影用法與相容

來源:互聯網
上載者:User
#mydiv{width:30%;height:50%;min-height: 650px;float:left;border:1px solid white;    /*以下為各大瀏覽器的漸層 背景*/    /*webkit,如Chrome、Safari等*/      background:-webkit-gradient(linear, 0% 0%, 100% 0%, from(#b1d2eb), to(#8ec0e7));    /*IE系列*/    FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=1,startColorStr=#b1d2eb,endColorStr=#8ec0e7);    /*Firefox*/    background: -moz-linear-gradient(left, #b1d2eb, #8ec0e7) no-repeat;        /*Opera*/    background: -o-linear-gradient(left, #b1d2eb 0%,#8ec0e7 100%); }
參數: IE系列filter:參數:startColorStr起始顏色 endColorStr結束顏色 gradientType為0時代表垂直,為1時代表水平 Firefox參數:top、bottom垂直,left、right水平 例如:top時從頂部由#b1d2eb到#8ec0e7漸層,bottom時從底部由#b1d2eb到#8ec0e7漸層 Opera參數:top、bottom垂直,left、right水平 例如:top時從頂部由#b1d2eb到#8ec0e7漸層,bottom時從底部由#b1d2eb到#8ec0e7漸層 webkit,如Chrome、Safari等background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#b1d2eb), to(#8ec0e7)); 
/*陰影*/box-shadow: 5px 5px 5px #61a5d5;  /*ie 9.0以上*/-moz-box-shadow: 5px 5px 5px #61a5d5; /*firefox*/ -webkit-box-shadow: 5px 5px 5px #61a5d5;/*chrome等*//*圓角,ie9.0以,IE8.0及以下可以用jquery外掛程式解決*/border-radius:8px;

 

 
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.