Having company name on top of image

i have an image in a usercontrol in webapplication page
the usercontrol has
<img alt=“” src=“images/images.jpg” height=“120” /> <p>Company Name</p>
<p>Company Address</p>
which is called in a <TD> of another page

wht i need is the company name & the address shld be on the top of this image
how can it be done

The easiest and most reliable way is to set the image as a background via CSS rather than have it in the HTML. TBH, I’m not sure how well that will work with a <td>, but worth a try, anyhow. Does the other page have to put this in a <td>? Sounds like the wrong container to me. :slight_smile:

i knw this is not the perfect way for layout
but i felt it little easier . so i took a <table><tr><td> & applied css to it

so using cssi will set the background image of teh td & then using <p> will set the name
i hope t shld work as dersired , will let u knw

i have .headerbg
{
background-image: url(‘~/images/header.jpg’); background-repeat: no-repeat; background-position: center;
}

i have used the css & used it as class=“headerbg”

but i am not getting teh image dispalyed

Perhaps post your whole code, as it should work. Are you sure that’s the right image path? Is there a folder called ~ ?

as i said
project root folder
main.aspx
head.ascx

       css folder  in project root folder with a.css which contains .headerbg
       header.jpg in images folder in project root folder

main page contains the <td> where i need the image

head.ascx conatins company name

OK, then address this:

url('[COLOR="#FF0000"]~[/COLOR]/images/header.jpg')

Change it to

url('[COLOR="#FF0000"]..[/COLOR]/images/header.jpg')

Thanks ralph i do get it now as needed
it was the path error which u solved

Thanks once again

there is a smiliar issue
i have 2 label controls in a user control one lable control must be place at the left & another right
i tried using <p> but if i use <p> & even <h4> but how do i align horizontally left & right??

You could try floating them left and right.

<div style=“color: Navy; background-color: Transparent; float: left;”>
<asp:Label ID=“dt” runat=“server” Text=“Label”></asp:Label>
<div style=“color: Navy; font-weight: bolder; background-color: Transparent; float: right;”>
<asp:Label ID=“ser” runat=“server”></asp:Label></div>
</div>

i have this but both r comming at left only

You need to have two separate divs rather than one nested in the other:

<div style="color: Navy; background-color: Transparent; float: left;">
    <asp:Label ID="dt" runat="server" Text="Label"></asp:Label>
</div>

 <div style="color: Navy; font-weight: bolder; background-color: Transparent; float: right;">
    <asp:Label ID="ser" runat="server"></asp:Label>
</div>

Thanks got it