CSS中的文字不透明度 [英] Text opacity in CSS

查看:80
本文介绍了CSS中的文字不透明度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法可以处理wordpress小部件内的文本,从而使用不透明功能将其设置为半透明?仅将自己限制在以下代码块的内容中。

Is there any way I could treat text inside of a wordpress widget, to make it semi transparent using an opacity funcion? Only limiting myself to the content of the following code block.

#content .widget .caption h3 {
color:#000000;
font-family:'Overlock';
margin:0 -10px;
padding:0 10px;
font-size:27px;
height:46px;
line-height:46px;
font-weight:bold;

}

使用以下选项,整个小部件将被视为透明的。

With the option below, the entire widget will be treated as transparent.

 #content .widget .caption h3 {
color:#000000;
font-family:'Overlock';
margin:0 -10px;
padding:0 10px;
font-size:27px;
height:46px;
line-height:46px;
font-weight:bold;
opacity:0.2;

}

我只想要改变了它的不透明度

I only want the to have its opacity changed. Is it even possible that way?

推荐答案

您可以使用 rgba 作为颜色属性,如下所示:

You can use rgba as the color attribute like this:

color: rgba(0,0,0,0.5);

最后的 0.5 指定50%不透明。这将仅适用于文本,而不适用于包含元素。

The 0.5 at the end specifiies 50% opacity. This would apply only to the text, and not the containing element.

您必须注意浏览器兼容性

这篇关于CSS中的文字不透明度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆