Planetaryhtml
Home Back

P

Html images

It does not matter to the web server or web browser, just where you put your images as long as you know where they are and use the correct paths in your html code. Personally i prefer to put all the images in a separate directory or folder, so that all images or other assets such as multimedia and javascript files are neatly organized. The image tag defines an image in an HTML page. The image tag has two required attributes: src and alt. Images are not technically inserted into an HTML page, images are linked to HTML pages. The tag creates a holding space for the referenced image.

IMGstands for "image." It announces to the browser that an image will go here on the page. Yes, the image will pop up right where you write in the image tag.

SRC stands for "source." This again is an attribute, a command inside a command. It's telling the browser where to go to find the image. Again, it's best for you to place the images you want to use in a subdirectory called "images".

The HTML command to place an image is constant. You will use the same format every time. Now might be a good time to talk about where to store everything on your web server because you're starting to call for additional items to fill up your home page. Until now, all you did was put text on the page. Now you're going to place an image. At this point in your HTML career, it's a good idea for you to place whatever images you are going to use in a subdirectory called "images".

Inserting using link

Inserting image from PC

Giving a proper size

Practice here

HTML (Body)
CSS
JavaScript
Output