views:

39

answers:

2

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, Su

A: 

Basically you're trying to overlay html elements on top of each other.

http://www.websiteoptimization.com/speed/tweak/overlay/

Look at the above url for examples

Hasan Khan
Thanks for the solution
Sunitha
A: 

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> 
ajay_whiz
Thanks a lot. This serves my problem.
Sunitha