我不知道在css中是否可能实现这一点,但我确信可以在js中完成,只是我不知道怎么做...
我有一个带背景的div,里面有一个带另一个背景的div的文本。 我想要的是将文本设置为透明,并将第一个背景设置为文本背景。如果不清楚,我已经创建了一个fiddle来展示:
<div id="first-background">
<div id="second-background">
<h1>This text should be transparent and have the first-background as its background and ignore the second background.</h1>
</div>
</div>