简体   繁体   English

如何在HTML5 / CSS3网站上的文本周围添加彩色框?

[英]How can I get a colored box around text on my HTML5/CSS3 website?

Text is a little difficult to read on my current website -- I'd like to add a semi-transparent black box around my text area. 在我当前的网站上,文字有点难以阅读 - 我想在文本区域周围添加一个半透明的黑框。 Is there anyway to do this? 反正有没有这样做?

Here's a rough example of what I want to do: 这是我想要做的一个粗略的例子:

我想要的粗略例子

Thanks! 谢谢!

Put it in a div container and give that div a background-color: rgba(0,0,0,0.7); 把它放在一个div容器中,给它一个background-color: rgba(0,0,0,0.7); . 0.7 being the opacity. 0.7是不透明度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM