Put background image over text?

后端 未结 5 1589
遥遥无期
遥遥无期 2020-12-05 21:26

This is not the apparently-common question about how to put text over a background image.

I have a background image that I want to work as an overlay -- it should be

5条回答
  •  清歌不尽
    2020-12-05 22:16

    This is definitely not possible, and rightfully so. It would be wrong (and confusing) if you could use the background property of an element for anything other than the background.

    The right way to do this is with an absolutely positioned div (with width and height set to 100%) within the container, alongside the text: http://jsfiddle.net/EvqNb/

提交回复
热议问题