jquery - 如何修复背景不透明度 css

标签 jquery html css

是否可以只对背景而不对文本实现不透明度?

演示:http://jsfiddle.net/4Zbsd/

.box
{
background-color: #000;
opacity: 0.7;
filter: alpha(opacity=70);
color: #fff;
height: auto;
width: 232px;
margin: 5px 0px 0px 20px;
padding: 1px 0px 1px 15px;
border-radius: 15px;
border: solid 1px #000;
}

最佳答案

给你 - http://jsfiddle.net/4Zbsd/7/

在背景属性上使用 rgba 颜色 - "background: rgba(0, 0, 0, .7);"

 .box
    {
    background: rgba(0, 0, 0, .7);
    color: #fff;
    height: auto;
    width: 232px;
    margin: 5px 0px 0px 20px;
    padding: 1px 0px 1px 15px;
    border-radius: 15px;
    border: solid 1px #000;
    }

关于jquery - 如何修复背景不透明度 css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24516703/

相关文章:

javascript - 如何在一行中干燥我的 jQuery 代码

javascript - 检测框架位置/内容已更改

php - 单个数组中的多个 mysql 查询结果

javascript - 通过 .htaccess 添加文件以指定标签

CSS flex 盒 : how to change the width of the element

javascript - Electron 没有在应用程序中完全更新已编辑的 index.html

tabs - 如何在文本框中按 Tab 键后触发事件

jquery - 打开新 div 时关闭 div(jQuery 幻灯片)

javascript - 如何使用 jQuery 检查输入中的重复值

html - 图像不在原地,随着窗口的调整而拖动