Jump to content

Inserting Images


tibi

Recommended Posts

Hi could somebody help me ? The picture does not show in the web page I used the following syntax: <img src="C:\Documents and Settings\Tnagy\Desktop\Foto Chips\DSC_0127.jpg" alt="think is a picture"/> Where is the mistake as the path should be correct I copy it and paste it from the address bar plus I add the DSC_0127.jpg. Thank you

Link to comment
Share on other sites

Hi could somebody help me ? The picture does not show in the web page I used the following syntax: <img src="C:\Documents and Settings\Tnagy\Desktop\Foto Chips\DSC_0127.jpg" alt="think is a picture"/> Where is the mistake as the path should be correct I copy it and paste it from the address bar plus I add the DSC_0127.jpg. Thank you
i think it would be better if you started your own thread. however, are you trying to view this webpage from your computer or online? What you have posted is an example of an absolute link, and will work only from within the context of your local machine. Ideally all your project files (html, css, images, etc) should all be within a single folder, and your links should be relative to that. a common practice is to create an images folder within the root project folder and your links would typically look something like
images/filename.jpg

also, you should get in the habit of using underscores or camel casing for file/folder names.

Link to comment
Share on other sites

Hi there, I have here two syntax nr.1 is with a picture from my computer and nr.2 is from W3Schools.com web site.Both I taped them in Notepad for a test web page as I try to learn HTML.But only the second one shows in my test web page, why is that? 1 <img src="C:\Documents and Settings\Tnagy\Desktop\Picture_Chips\DSC_0119.JPG" alt="think is a picture"/> 2 <img src="http://www.w3schools.com/images/w3schools_green.jpg" alt="W3Schools.com" width="104" height="142" />

Link to comment
Share on other sites

To link to files on your computer you have to use the file:// protocol.

<img src="file:///C:\Documents and Settings\Tnagy\Desktop\Picture_Chips\DSC_0119.JPG" alt="think is a picture"/>

It has three slashes: the first two from the URL syntax and the third refers to the root of the system. Links to local files will only work for a page that's on your computer. (This excludes localhost)

Link to comment
Share on other sites

I think you should post your code as it stands now, given that you have opted to put the image in that folder as your other documents (which is a better practice). Verify again that image is named correctly, including spaces, capitlization, etc and make sure the image itself opens well in any basic image editing/viewing program. If possible, upload to someplace where we can verify paths ourselves.

Link to comment
Share on other sites

go to the folder where the image is located, right-click on image, select 'Open with' , if you have a browser within the list of programs, select that! If not, select the 'Choose default program...' from the bottom of menu list, this will open another window where another list of programs will be listed, if you can't find any browser, use the browse button to select your browser of choice from program files, once selected you return back to the list of programs, and you should see your chosen browser, uncheck 'always use the selected program to open this kind of file' checkbox, and select OK. This should now open the selected image file in the browser, and if you look in the address bar you find the correct address to use. it should be file:///C:/Documents and Settings/Tnagy/Desktop/Picture_Chips/DSC_0119.JPG all the slashes should be facing in the direction above.

Link to comment
Share on other sites

I did it, but on my home computer.Everything that I wrote above was about a company computer at my work which is connected to a intranet.Even though the picture was on the computer hard drive not on the company server.Could that be a reason why I couldn't do it ?I will check the URL later today and I believe won't bother you guys with this topic again. Thank u all

Link to comment
Share on other sites

I think I said earlier that it only works if the HTML file is running on the local filesystem. That means that the HTML file is on the same computer as the image and that it is being accessed through the file protocol.

Link to comment
Share on other sites

you should really just put it in a folder with the HTML/CSS documents that will be referencing it. As soon as you move any of these files to a different computer or upload them, all these links will break. Plus you could have a much simple file path. i.e.

images/potato_chips/DSC_0119.JPG

also, are you absolutely sure your casing is correct? Both in the file name and the extension?

Link to comment
Share on other sites

Both the HTML and the picture have the same URL they are both in the same folder and the casing is correct.The curiosity is that on my home computer is working and at work computer not.I will ask the system administrator what could be the problem maybe he has the answer. Thank you guys again PSFrom my point of view case closed.

Link to comment
Share on other sites

Both the HTML and the picture have the same URL they are both in the same folder and the casing is correct.The curiosity is that on my home computer is working and at work computer not.I will ask the system administrator what could be the problem maybe he has the answer. Thank you guys again PSFrom my point of view case closed.
Are you trying to access the website you've made on your local computer from work? Does this mean you have a live link for us to view then?
Link to comment
Share on other sites

No,no it is the computer at work which has nothing to do with the home computer.Only that at home doing this exercise(inserting pictures) I manage to do it and at work no.Different computers different folders different pictures each with there own URL only the syntax is the same <img src="url" alt="some_text"/>.At home works and at work no.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...