Image code in textpad not showing?!

Discussion in 'Software' started by rrdjfan777, Jan 28, 2012.

  1. rrdjfan777

    rrdjfan777 Private E-2

    Okay got this homework coming up, and been using this program "Textpad" for html coding. I got this page look good, BUT.

    When I open the page I made in a browser, the only thing not working right is the image. It won`t bloody show, and I don`t know why. My teacher said online that I entered the code wrong, but wtf, what am I not realizing? This should work, why doesn`t it you think???:


    <h1 style="text-align: center"><img src="JPEG Image" alt="dessertweb"/></h1>

    He said that "Your src attribute needs to be the image file name. Try that."

    But I don`t know what he means, I`m new to this sh** lol
     
  2. GermanOne

    GermanOne Guest

    I assume he is absolutely right. A file name would be something like "yxz.jpg" or "abc.gif". What's the name of your file?

    <img> tag

    Regards
    GermanOne
     
  3. rrdjfan777

    rrdjfan777 Private E-2

    The name of file is "dessertweb", its type is "JPEG Image"....I assume the jpeg is the name, but how can I fix my problem? I`m like a total noob, and been trying to fix this for minutes now lol
     
  4. GermanOne

    GermanOne Guest

    Seems you're a bit slow on the uptake at the moment lol.
    Have you followed my link?

    src="dessertweb.ext"
    ... where .ext is for the file extension. I don't know what it is in your case. Perhaps .jpg or .gif or something else. You have to know it - latest if you have a look at the file properties.

    Regards
    GermanOne
     
  5. PC-XT

    PC-XT Master Sergeant

    The alt="..." part really has nothing to do with the filename. It gives text to display in place of the image, or to use for accessibility. It often pops up if you hover over the image. People often use the filename here, but it's meant to be human-readable.

    For the JPEG filename, you could try the following, but it might be something else. These are the most common extensions:
    src="dessertweb.jpeg"
    src="dessertweb.jpg"
    src="dessertweb.jpe"
    src="dessertweb.jfif"
    When you save the file, the program usually uses the first extension listed in the "Save as type" box.
    The only way to be sure is to check the file's properties, as GermanOne said.
     
  6. sach2

    sach2 Major Geek Extraordinaire

    You should have file extensions showing on your computer if you are working with coding.
    I'm guessing Win7 so in an Explorer window hit the Organize button on the top left and select Folder and Search Options. On the View tab uncheck the box for "Hide extensions for Known File types". Then Apply and close the window. Take a look in the folder with your dessertweb file and you should now see the full name including extension.
     
  7. rrdjfan777

    rrdjfan777 Private E-2

    Okay this worked perfectly, so NOW I know the filename which is dessertweb.jpg. But the image still come up when I entered

    <h1 style="text-align: center"><img src="dessertweb.jpg"/></h1>

    I just got this white, broken seal looking thing where the image should be???

    And thanks, never knew I could see file extensions that way!
     
  8. sach2

    sach2 Major Geek Extraordinaire

    I don't know html but which folder is your dessertweb.jpg photo located?
    Perhaps using the full path for the photo would help. ie. C:\images\dessertweb.jpg or whichever folder holds your photo.

    <h1 style="text-align: center"><img src="C:\images\dessertweb.jpg"/></h1>

    You might also try just the img part to see if you can get the photo to appear without specifying the style as a temporary test.

    <img src="C:\images\dessertweb.jpg"/>

    The C:\images part is just a made up folder. You would want to substitute the actual folder where your image is found.
     
  9. rrdjfan777

    rrdjfan777 Private E-2

    OMG That absolutely helped me figure out the answer to my problem, my images showed up just fine. Thank you very much!!:)
     
  10. sach2

    sach2 Major Geek Extraordinaire

    You're welcome. Good work! :)

    One thing to keep in mind if you are doing programming is computers are dumb! You have to be very specific and tell it everything when programming. As you found out it can't guess that your picture is in your usual image folder. You have to tell it exactly where the image is or it just stops dead or doesn't display the image.

    Telling a computer to crack an egg would look something like:
    Find the refrigerator
    Open the door
    Find the eggs
    Select an egg
    Pick it up
    Shut the refrigerator
    Turn around and face the counter
    Find a bowl
    Tap the egg firmly against the side of the bowl
    Pour the egg into the bowl.


    Skip telling it a step like "Find a bowl" and when it gets to "Tap the egg firmly against the side of a bowl" and will just say "What bowl?" and quit.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds