Help with images, Can't get images to appear on webpage |
Help with images, Can't get images to appear on webpage |
Reese2012 |
Jan 20 2019, 01:53 PM
Post
#1
|
Group: Members Posts: 1 Joined: 20-January 19 Member No.: 26,800 |
I am having trouble getting an image to appear on my webpage. I uploaded it to Pictures, in a folder called images. the name of the photo is cat in a tree. I have tried the following codes to get the photo to appear: <img src="images/cat in a tree.jpg"> I have aslo tried <img src="pictures/images/cat in a tree.jpg"> and nothing is working. What have I done wrong?
|
CharlesEF |
Jan 20 2019, 06:32 PM
Post
#2
|
Programming Fanatic Group: Members Posts: 1,981 Joined: 27-April 13 From: Edinburg, Texas Member No.: 19,088 |
You can't have spaces in a file name without extra work. If you want to keep the spaces then you must URLencode it. Basically change the spaces to '%20'. I suggest you just change the file name to use '-' or '_' instead of spaces.
|
pandy |
Jan 20 2019, 07:51 PM
Post
#3
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Just to clarify. You can have spaces in the file name but not in the URL. It's in the URL you need to use %20. So if the file name is
CODE cat in a tree.jpg you need to write the URL like below. CODE cat%20in%20a%20tree.jpg So as CharlesEF says, much easier and neater (more readable) to use for instance underscores or hyphens. In both the file name and the URL. CODE cat_in_a_tree.jpg cat-in-a-tree.jpg |
Christian J |
Jan 21 2019, 10:52 AM
Post
#4
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
I uploaded it to Pictures, in a folder called images. Is "images" a folder inside another folder called "Pictures"? QUOTE I have aslo tried <img src="pictures/images/cat in a tree.jpg"> URLs are case-sensitive, so try CODE <img src="Pictures/images/cat%20in%20a%20tree.jpg" alt="Cat in a tree"> See also http://htmlhelp.com/faq/html/images.html#broken-image |
Lo-Fi Version | Time is now: 26th April 2024 - 03:53 AM |