Making text background transparent but not text itself

后端 未结 5 1610
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 23:53

So I am having a problem. I have looked around and looked around but no luck. I would like to make the background of my body transparent but leave the text non transparent.

5条回答
  •  没有蜡笔的小新
    2020-11-29 00:33

    For a fully transparent background use:

    background: transparent;
    

    Otherwise for a semi-transparent color fill use:

    background: rgba(255,255,255,0.5); // or hsla(0, 0%, 100%, 0.5)
    

    where the values are:

    background: rgba(red,green,blue,opacity); // or hsla(hue, saturation, lightness, opacity)
    

    You can also use rgba values for gradient backgrounds.

    To get transparency on an image background simply reduce the opacity of the image in an image editor of you choice beforehand.

提交回复
热议问题