How do I put html file and image in same directory
Hi, Im doing html code to upload the image, but only a block comes up, I heard I must have the html file and image in a same directory, but how do I do that, the images are in a file called webpage templates, then the subfolder is model3.jpg. I just named the image model3,jpg.
I put this code in. <img style = "width: 70px: height: 70px: border: 0;" src = "model3.jpg" alt = "text description">
Only an empty block comes up., no image.
The blank box is coming up probably because the image file is either:
Originally Posted by wildguy2
1. Not in the same directory as the html file. If so, what you need to do is include a relative path of the image file. e.g. If the html file is in a given folder and the image is in a sub-folder of that folder called "graphics" the syntax should be as above except:
src = "graphics/model3.jpg"
2. In the folder, but the name is incorrect. File names on many servers are case sensitive. E.g. If the image file is called "Model3.jpg", or even "model3.JPG", the server will not find it because you have told it to load "model3.jpg".
See Absolute and Relative Paths. Do not name folders and files using whitespace (like "webpage templates") and use lowercase. Files do not have to be in the same folder to work, but you should have a directory structure that makes sense and use the right path to files that maintain the correct relationship.
You forgot to add the file name, to locate the image.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)