如何在背景图像上添加文本

How to add text on the background Image

本文关键字:添加 文本 图像 背景      更新时间:2023-09-26

我想在我的离子手机的背景图像上添加一些文本。我使用了这个代码示例来添加背景图像。

<ion-content >
    <div  class="hero slide-up" style="background-image: url('img/vegi.jpg');">    
    </div>
</ion-content>

只需在div中写入文本。。。如果你想对文本有更多的控制权,你可以把它包装在pspan标签中,然后根据你的喜好定位。

<ion-content >
        <div  class="hero slide-up" style="background-image: url('img/vegi.jpg');">
             <span>my text goes here</span>
        </div>
</ion-content>