gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 04:24:48 25 4
gpt4 key购买 nike

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

HTML:

<div class="ts-twentytwelve-description">into quality solutions</div>

CSS:

border-left: 9px solid #fff;
border-right: 9px solid #fff;
background-color: black;
opacity: 0.86;
filter: alpha(opacity=86);

最佳答案

你可以这样做:

.ts-twentytwelve-description {
border-left: 9px solid #fff;
border-right: 9px solid #fff;
background-color: rgba(0,0,0,.86);
}

使用 background-color:rgba(value) 可以仅为背景色添加不透明度。对于 IE,你有 generator here

关于html - 如果 div 是透明的,则使边框不透明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18465032/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com