我有一个对话泡泡形状的 div。这是代码:
<div class="dragThis" id="dragThis">
<div class="content" id="content">
<p>
<asp:Label ID="lblContent" runat="server" Text="Label"></asp:Label>
</p>
</div>
<div class="pointer">
<div class="one">
</div>
<div class="two">
</div>
</div>
</div>
这是CSS:
<style type="text/css">
.dragThis
{
width: 400px;
color: #efefef;
position: absolute;
}
.pointer
{
-moz-opacity: 0.5;
-khtml-opacity: 0.5;
filter: alpha(opacity=50);
height: 560px;
}
.dragThis .pointer
{
height: 35px;
background: #393939;
}
.dragThis .pointer div
{
height: 100%;
background: #ffffff;
}
.dragThis .pointer .one
{
width: 50%;
-moz-border-radius-topright: 35px;
-webkit-border-top-right-radius: 35px;
float: left;
}
.dragThis .pointer .two
{
width: 50%;
float: right;
-moz-border-radius-topleft: 35px;
-webkit-border-top-left-radius: 35px;
}
.dragThis .content
{
padding: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
background: #393939;
text-align: center;
}
</style>
这里的问题如您所见,对话泡泡的下部有 %50 可见。我希望黑色部分 %100 可见,其他所有部分都是透明的。
谢谢。
最佳答案
一个工作示例会很好。
您不能将不透明度分成不同的部分。但是如果您的元素没有背景,它将是透明的,除了边框。
关于css - 使 div 透明但保持边框可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4911946/