html - 文字颜色随着透明框褪色
问题描述
我注意到我的文本颜色随着透明框的不透明度一起褪色。但我真的不知道将我的文本与不透明度分开的正确代码是什么。对不起,如果这个问题听起来有点愚蠢。
body {
background-color: gray;
}
.container {
position: relative;
text-align: center;
}
.content {
position: absolute;
top: 20%;
left: 0;
right: 0;
background-color: white;
opacity: 0.3;
width: 70%;
margin: auto;
padding: 5px;
color: black;
font-size: 30px;
font-family: calibri;
text-align: center;
}
<body>
<div class="container">
<div class="content">
<h3>Welcome to MedCare</h3>
</div>
</div>
</body>
解决方案
推荐阅读
- angular - Angular 11字体内联失败
- azure - 有关使用 Azure 数据工厂的问题
- java - 每个端点的自定义杰克逊解串器
- macos - 在 mac os 上,如何使用命令行删除 IPC 中名为 POSIX 的信号量?
- p5.js - 如何创建圆角矩形?
- python - 有没有更好的方法来获取字典列表中的字典值?
- flutter - 颤振的相机插件没有像预期的那样工作,并不断给出很大的错误消息
- flutter - Flutter Firebase 事务
- unity3d - Unity Editor 脚本、ApplyModifiedParametesr 和保存场景。有些东西不工作
- python - 如何用python绕过响应503