Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a simple html img control I would like to add a background image to. I have the following but the background image does not show. The image being referenced is there. I can see it in the second image control. I just don't see it as a background. Any ideas?

 

<img id="htmlImg" style="background-image: url('physicianGraphic.jpg'); background-position:top center;" src="uploadedimages/Member_Photos/adkins.jpg" alt="Doc Photo Test" />

 

<img id="Img1" src="physicianGraphic.jpg" alt="Doc Photo Test" />

 

Thanks!

  • 1 year later...
Posted

I am not sure if you can set a background image in an image control. You can try to wrap it with a div and then put your background image in the div.

 

<div style="background-image: url('physicianGraphic.jpg')">
<img src="physicianGraphic.jpg"/>
</div>

Ignorance begins with I.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...