边框颜色不透明

时间:2013-11-20 06:48:35

标签: html css

我的按钮就像这样

.btn {   
   background: #3a4446;   
   background-image: -webkit-linear-gradient(top, #3a4446, #0a0b0c);
   background-image: -moz-linear-gradient(top, #3a4446, #0a0b0c);
   background-image: -ms-linear-gradient(top, #3a4446, #0a0b0c);
   background-image: -o-linear-gradient(top, #3a4446, #0a0b0c);
   background-image: linear-gradient(to bottom, #3a4446, #0a0b0c);
   -webkit-border-radius: 11;
   -moz-border-radius: 11;
   border-radius: 11px;
   font-family: Arial;
   color: #ffffff;
   font-size: 20px;
   padding: 10px 20px 10px 20px;
   border: solid 5px;
   border-color: rgba(0,0,0,0.5);
   text-decoration: none; 
}

我想减少边框颜色的不透明度我添加了颜色作为rgba模式,但有些问题请帮助

1 个答案:

答案 0 :(得分:2)

希望它会帮助你

   .class {
border: 1px solid rgba(255, 0, 0, .5);
-webkit-background-clip: padding-box; /* for Safari */
background-clip: padding-box; /* for IE9+, Firefox 4+, Opera, Chrome */
 }