We'd like to remind Forumites to please avoid political debate on the Forum. This is to keep it a safe and useful space for MoneySaving discussions. Threads that are - or become - political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.
We're aware that dates on the Forum are not currently showing correctly. Please bear with us while we get this fixed, and see Site feedback for updates.

Inserting images html

I hope someone on here could advise me please, I am learning simple html and am having problems with inserting images, my browser doesn't show the image just a small box with an X in it where it should be. I can do it using an image from a website but when I save an image into the same folder as the html file when i add it to my notepad doc and check the browser its just the small box with a X?

Can anyone tell me where i'm going wrong?
We love what we are doing and we love why we're doing it!!

Comments

  • GreenNotM
    GreenNotM Posts: 1,087 Forumite
    all relative - you need the correct directories/paths from where you store the html to where you store the images.

    Ceate an images folder in the folder where you store the html - try the full address first c:\......\...\images\*.jpg then shorten ....

    paste the code lines src=" ... etc
    Rich people save then spend.
    Poor people spend then save what's left.
  • :confused: Still having problems, i'm saving an image to the folder where my html is, then
    on my notepad adding <img src="image name.jpg"> - have also tried the long c:\ etc etc but still comes out with no image just a box where it should be ?????
    Could it be something to do with my computer settings?
    I'm sure its something really silly i'm not doing quite right, at least i have till June to finish the course - may have sussed it by then:D
    We love what we are doing and we love why we're doing it!!
  • Halloway
    Halloway Posts: 1,612 Forumite
    Peter_Pan wrote: »
    :confused: Still having problems, i'm saving an image to the folder where my html is, then
    on my notepad adding <img src="image name.jpg"> - have also tried the long c:\ etc etc but still comes out with no image just a box where it should be ?????

    If the image file is in the same folder as your html then it should work fine. Check the obvious things - that you actually have the filename correct. Try removing any spaces from your image filename and redo your html. Check that your image file is actually a jpg, not something else.

    Using "C:/etc/etc" won't generally work as html doesn't really understand about hard drives and it's bad practice anyway. You should always use relative paths.

    If that fails please feel free to post your html here and I'll have a look. The following code works for me, saved to My Documents, with the image file in My Pictures:

    <html>
    <head></head>
    <body>
    <img src="My Pictures\metallic clouds.png">
    </body>
    </html>
  • Many thanks for your help

    Have just checked everything again and redid my html and still not happening:confused:
    my html i have used is

    <html>
    <head>
    <title> ***********</title>
    </head>
    <body>
    <img src="CatHat1.jpeg">
    <u><b><font face="alba" size="6">********</b></u></font><p>

    Have put in ***** s in place of the content. The image is in My docs, then in another folder within mydocs where the html is also.
    Could you explain what you mean by "relative path" please.

    I hope you spot a silly mistake i have made, I have been trying for weeks , keep leaving it and coming back another day to see if i can spot what i've done wrong but haven't so far.

    Fingers crossed

    Debbie
    We love what we are doing and we love why we're doing it!!
  • GreenNotM
    GreenNotM Posts: 1,087 Forumite
    use lower case for everything, try for .jpg files -

    all relative - where you start from and how you get there - so html file on ur desktop image file in a desktop folder "images"

    <html>
    <head>
    <title> ***********</title>
    </head>
    <body>
    <img src="images\cathat1.jpg">
    <u><b><font face="alba" size="6">********</b></u></font><p>
    etc etc

    The point of using the full path on your learning curve was to ensure that the file does show in a browser - open the image in IE - right click>> properties - use the "address" for the name in ur code, to ensure that is all correct - then shorten ... this will also be shown in the address bar - so u can copy this to ensure the file does show ....

    drag cursor to get the correct address over the property field and copy and

    paste it into ur code
    Rich people save then spend.
    Poor people spend then save what's left.
  • Thanks for helping,and sorry for being a pest, i think i'll be bald by the time i get this sussed!! i have opened image up and checked the properties and it all looks okay, and i have tried lowercase as well. I just don't understand why its not working, I have gone back over my course notes and looked up on internet and can't see what i'm doing wrong.
    Going to give up again tonight and try again tomorrow.
    Just to say i do have probs sometimes on forums getting some not all images to display when people have posted pictures and photos - does that help anyone explain what i need to do?????

    Many thanks again
    Debbie
    We love what we are doing and we love why we're doing it!!
  • Halloway
    Halloway Posts: 1,612 Forumite
    Peter_Pan wrote: »
    Just to say i do have probs sometimes on forums getting some not all images to display when people have posted pictures and photos - does that help anyone explain what i need to do????

    Hmmm. Which browser do you use? Try using a different browser, e.g. Firefox or Opera. Try clearing your cache (In IE this is under Tools->Delete Browsing History). Check that your browser is not set to not display images. Try using a different kind of image in your html code, e.g. a .bmp, .gif or .png.
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 348.3K Banking & Borrowing
  • 252.1K Reduce Debt & Boost Income
  • 452.4K Spending & Discounts
  • 240.9K Work, Benefits & Business
  • 617.2K Mortgages, Homes & Bills
  • 175.7K Life & Family
  • 254.1K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 15.1K Coronavirus Support Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.