我知道该怎么做border opacity,怎么办background image opacity,但我想有一个元素没有边界不透明度,其上底色,图像不透明度。我不想在图像编辑器中修改图像,所以我正在寻找由CSS设置的不透明度。可能?元素(背景图片)混浊,但没有边界的不透明度
在我的CSS下面我想修改“禁用”状态与锋利的不透明边界。请指点...利用
例子:this fiddle
按钮样式:
div.button, div.button:hover
{
background: none;
border: 2px solid #6C7B8B;
border-radius: 8px;
clear: none;
color: transparent;
cursor: pointer;
display: inline-block;
filter: alpha(opacity=100);
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
float: none;
height: 24px;
margin-bottom: 0px;
margin-left: 3px;
margin-right: 0px;
margin-top: 7px;
opacity: 1;
-moz-opacity: 1;
outline: none;
overflow: hidden;
padding: none;
vertical-align: top;
width: 24px;
}
点击效果:
div.button:active
{
left: 1px;
position: relative;
top: 1px;
}
额外的样式为禁用状态:
div.disabled, div.disabled:hover
{
cursor: default;
filter: alpha(opacity=50);
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
opacity: 0.50;
-moz-opacity: 0.50;
}
div.disabled:active
{
left: 0px;
position: relative;
top: 0px;
}
额外的样式状态ON:
div.on, div.on:hover
{
border: 2px solid #007FFF;
}
为了让您可以在边框的彩色部分使用RGBA({值})。边界不透明度。你也可以透明(在同一部分)使边框消失。 – ppsreejith 2012-07-11 23:44:40
为什么你想要不透明,而不是降低颜色?你有一个按钮,颜色:透明;背景:无;',顺便说一句 - 你能向我们展示你的页面吗? – Bergi 2012-07-11 23:45:37
为什么你使用div.button而不是真正的按钮,它甚至有一个禁用的属性? – Bergi 2012-07-11 23:47:00