Is there a way to use use text as the background with CSS?

前端 未结 8 696
暖寄归人
暖寄归人 2020-11-28 03:48

I would like to use dynamic text as background of certain elements in my tag. Because of this, I can use images (dynamic text). How do I do it with just CSS or JavaScript?

8条回答
  •  遥遥无期
    2020-11-28 04:30

    You could make the element containing the bg text have a lower stacking order ( z-index, position ) and possibly even set opacity. So the element you need on top would need a higher stacking order ( z-index:5; position:relative; for ex ) and the element behind would need something lower ( default or just a lower z-index like 3 and position:relative; ).

提交回复
热议问题