Help - Search - Members - Calendar
Full Version: Help with images
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
Reese2012
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? blush.gif
CharlesEF
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
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
QUOTE(Reese2012 @ Jan 20 2019, 07:53 PM) *

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

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.