IMG Help


#1

Why is it i can add links to pages for videos with no problems. But, when i save a picture as a jpeg file in the same folder as my site and index file, i can’t figure out how to get the saved image to appear on the webpage i create?

i have tried using <img src="imagenamehere">
and <img src="imagenamehere"/>
and <img src="imagenamehere"></img>


#2

When organizing a website on a host server one will soon find the root directory filling up with all sorts of files which can get away from us in a hurry and make the site difficult to maintain. For this reason it is best to organize files in the their own folders. Typically these would be,

images
js
css
videos
pdf

These folders would be just off the root and the files inside them would be consistent and of the same (or similar) MIME type.

<link href="css/styles.css" rel="stylesheet">

<img src="images/my_picture.png">

The root directory should be free of clutter and contain only those files that absolutely need to be there, starting with the home page (index.html), the robots file (robots.txt), any search engine verification files, and the spate of other common files such as about.html, contact.html, etc.

One final consideration as images are concerned is whether they are content or window dressing. The latter can be referred to as skin images that might appear on every page and they can be incorporated into the style sheet and tucked away in the CSS folder in their own skin folder and loaded via background image declarations.

The correct tag for images is,

<img src="file.jpg" alt="">

Use of the closing slash is only necessary when serving as XML which we are not doing. When serving as text/html there are no slashes on void elements (self-closing tags).

As for why your image is not loading, we cannot tell given the information provided. Please show your HTML source document, and perhaps a list of the directory contents.


#3

Hello etjdogger.
You was very close, but you missed the extension of the image file (.jpg .png .gif .jpeg)
using your code as reference you should use

<img src="imagenamehere.jpg" />

or

<img src="imagefolder/imagenamehere.jpg" />

or as it was previously mentioned by mtf:

<img src="imagenamehere.jpg" alt="image description" />

note that IMG is a self-closing tag, that’s why you don’t need to close it with /img

Good luck.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.