我知道該怎麼做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