如何把一个标签在图像 [英] How to put a label over an image

查看:166
本文介绍了如何把一个标签在图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图寻找出一个可能的解决方案,我还没有找到一个。你能帮我如何在一个图像添加文本。 下面是我的code,我想lblWelcome和lblUsername过来的图像。

I was trying to look out for a possible solution and am yet to find one. Could you help me out how to add a text over an image. Below is my code and I want lblWelcome and lblUsername to come over the image.

   

    <img alt="Logo" src="../Resources/Images/Header.gif" style="height: 70px; width: 1000px;"/>

     <asp:Label ID="lblWelcome" runat="server" Text="Welcome " CssClass="HeaderMenuText"></asp:Label>

     <asp:Label ID="lblUsername" runat="server" CssClass="HeaderMenuText" Text=""></asp:Label>  

。将很高兴,如果有人能帮助我。

Would be glad if someone can help me with this.

TIA, 苏

推荐答案

另一种方式可以通过设置你的形象作为元素的背景图像和你的文本作为子元素 例如,

Another way can be by setting your image as the background image of an element and have your text as the child element e.g.

<div style="background-image: url(../Resources/Images/Header.gif);height:70px;width:1000px;" >     
     <asp:Label ID="lblWelcome" runat="server" Text="Welcome " CssClass="HeaderMenuText"></asp:Label>

     <asp:Label ID="lblUsername" runat="server" CssClass="HeaderMenuText" Text=""></asp:Label>
    </div> 

这篇关于如何把一个标签在图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆