Jump to content

images


polgee

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?

Link to comment
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.

Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...