Html 如果div是透明的,则使边框不透明

Html 如果div是透明的,则使边框不透明,html,css,Html,Css,是否有一些CSS方法可以使div透明,但边框不透明 HTML: 试试这个: div { background-color: rgba(0, 0, 0, .5); // or transparent border-color: #fff; } 编辑: 您可以使用此解决方案: <div class="border_div"> <div class="content_div"> your content here </div&g

是否有一些CSS方法可以使div透明,但边框不透明

HTML:

试试这个:

div {
    background-color: rgba(0, 0, 0, .5); // or transparent
    border-color: #fff;
}
编辑:

您可以使用此解决方案:

<div class="border_div">
   <div class="content_div">
       your content here
   </div>
</div>

.border_div {
    border: 5px solid #fff;
}

.content_div {
    opacity: .86;
}

你的内容在这里
·边境分区{
边框:5px实心#fff;
}
.content_div{
不透明度:.86;
}

以下是一个正在运行的JSFIDLE:

CSS:

HTML:

进入优质解决方案
您可以这样做:

.ts-twentytwelve-description {
border-left: 9px solid #fff;
border-right: 9px solid #fff;
background-color: rgba(0,0,0,.86);
}
使用背景色:rgba(值),您只能为背景色添加不透明度。
对于IE,您尝试过这个吗?左边框:9px实心#FFF;背景色:rgba(0,0,0,86)?
<div class="border_div">
   <div class="content_div">
       your content here
   </div>
</div>

.border_div {
    border: 5px solid #fff;
}

.content_div {
    opacity: .86;
}
.ts-twentytwelve-description {
border-top: 1px solid #000;
border-left: 9px solid #000;
border-right: 9px solid #000;
border-bottom: 1px solid #000;
background-color: transparent;
opacity: 0.86;
filter: alpha(opacity=86);
}
<div class="ts-twentytwelve-description">into quality solutions</div>
.ts-twentytwelve-description {
border-left: 9px solid #fff;
border-right: 9px solid #fff;
background-color: rgba(0,0,0,.86);
}