Jump to content

unable to get image to show same using CSS like it shows using standard <img>


jasonc

Recommended Posts

i am unable to get the image to show the same using CSS like it shows using the standard

<img src="images/myimg.gif" height="9" width="9" alt="the alt">

 

i am trying this but i get what i can only say looks like a broken image icon over the image that is shown.

img#myimg { background-image:url("images/myimg.gif"); background-repeat: no-repeat; line-height: 9px; }

<img id="myimg" alt="the alt">

 

what would be the correct way to do this.

Link to comment
Share on other sites

I was able to get that to work.  I think perhaps the image path is incorrect.  Also, set the height and width attributes to your CSS style to match the image.  See if that helps.  If not, fully quality your image path so you can take that off the equation just for testing.  Change it back to a local path when done testing.

 

Fully qualify:  http:www.example.com/images/myimg.gif

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.