The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Help with images, Can't get images to appear on webpage
Reese2012
post 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? blush.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Jan 20 2019, 06:32 PM
Post #2


Programming Fanatic
********

Group: Members
Posts: 1,579
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.
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jan 20 2019, 07:51 PM
Post #3


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,132
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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jan 21 2019, 10:52 AM
Post #4


.
********

Group: WDG Moderators
Posts: 8,043
Joined: 10-August 06
Member No.: 7



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

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 15th February 2019 - 03:48 PM