SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Problems inserting an image

  1. #1
    SitePoint Member
    Join Date
    Jan 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problems inserting an image

    Hello all,

    I'm just putting together my first website and for some reason I am having problems putting in an image.

    My markup is as follows:

    <p><img src="IMG_0769.jpg" width="200" height="160"
    alt="Picture of Me"/></p>

    For some reason, it won't load the picture, it just shows the box and the alternate. The picture with that file name is in the same folder as all the html/css files.

    Any ideas?

    Thanks very much

  2. #2
    Non-Member
    Join Date
    Jan 2011
    Location
    Heaven
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your code looks fine. Are you sure it's actually a jpg file and in the same folder as your html file? Are you sure the jpg filename is correct? Can you see images on other web pages?

  3. #3
    SitePoint Member
    Join Date
    Jan 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I can see images normally on the internet and i've tried changing the image name a few times.

    Definitely a jpeg - got file extensions on. I can open the image and look at it in an image viewer, just doesn't seem to want to show it in the browser...

  4. #4
    Robert Wellock silver trophybronze trophy
    SitePoint Award Recipient xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,259
    Mentioned
    52 Post(s)
    Tagged
    0 Thread(s)
    If you are getting the alternative text only and not the image the odds are your image path is completely wrong or you placed your file in the wrong place.

    I assume you have also used the browser to directly open the image itself to double-check you have the correct path and that it displays.

    It may also be useful to make sure you clear your cache and that you have saved your latest modified HTML file and do a forced 'reload/refresh' of the page. Make sure you are using the correct character case for the *.jpg if you have uploaded the files.
    };-) http://www.xhtmlcoder.com/
    Thinking Web: Voices of the Community

    > March 2013 - SitePoint forums: Spot the Error 3: Calling all Sleuths! Winner Announced!... She knows how to spot simple <code> errors but do you?

  5. #5
    SitePoint Enthusiast
    Join Date
    Oct 2010
    Location
    Brooklyn, NY
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The site path looks weird. Are you sure all your images are stored in the root folder?

  6. #6
    SitePoint Member
    Join Date
    Jan 2011
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, don't forget to check the file permissions - I had this issue a couple of times.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •