HTML (XHTML) Image Tutorials

The <img> is used to put an image in an (X)HTML document.

The "src" attribute tells the web browser the location of the image.

The "width" and the "height" attributes specify the dimensions of the image. It is necessary to specify the dimensions of images because if the dimension are not, the web browser will try to guess the dimension which in most likely will cause the layout of the document to jump around while it is loading

The <img> tag is a self-enclosing tag because it does not have a closing tag. The tag must end with blank space followed by a forward slash (/) preceding the ending bracket (>).

The code below shows you how to insert an image into a web page.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ""> <html> <body> <img src="image.jpg" width="90px" height="105px" alt="some text" /> </body> </html>

some text

Web Hosting Resources

Free Website Templates