Jump to content
Sign in to follow this  
polgee

images

Recommended Posts

I am an absolute beginner at HTML. I was doing OK I until I had tried to include an image sourced on my computer. I have used the address of the source file on my computer, but the browser only shows a small square icon. What am I doing wrong? I am saving the file as .html (all files) ANSI.

Another question. When files are uploaded to a website containing files housed on my computer, how does the browser locate the files when they are addressed to my computer?

Share this post


Link to post
Share on other sites

You should path your image relatively and not absolute.

 

Relative path = src="images/filename.jpg"

Absolute path = src="C:/win7/user/default/webfolder/images/filename.jpg"

 

Where ever html file is you should path it from that perspective. Ideally you should move or copy your images to a images folder.

Share this post


Link to post
Share on other sites

Getting the path correct is a common problem. You have to experiment until it finds the file. In Linux the path is case-sensitive.

Share this post


Link to post
Share on other sites

agree with having an images folder as some sort to container.

 

It's important that all your html, css, image, etc files are all bundled in a common parent directory. If you upload these files to a server, and you're referencing files on your local filesystem using absolute paths, it won't work. Relative paths with all files under a common parent directory is the preferred convention for uploading/deploying websites/apps.

Edited by thescientist

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...