Text opacity in CSS

前端 未结 2 1643
小蘑菇
小蘑菇 2021-01-21 04:19

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

2条回答
  •  时光取名叫无心
    2021-01-21 04:32

    You can use rgba as the color attribute like this:

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

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

    You've got to watch the browser compatibility

提交回复
热议问题