Images are also important for a web page that attract your users to take more interest in your website/blog.
How to insert Images:
Images are inserted using tag. It is unpaired tag which means tags which have no ending tag are not closed hence called VPN master.
Image Tag Attributes:
There is mainly one attribute to call an image but there are other too and using them makes your work more good.
Image Tag Attributes: |
|
Attributes |
Description: |
src |
It is mainly used to define source of image. |
alt |
It is used for the alternative text for image in case due to slow speed or for any reason the image is not displayed, this works here good. |
title |
It is used to define a title for image. It is now shown on image but when you scroll your mouse over images then it is shown. |
width |
Simply adjusts width of your image. |
height |
Simply adjusts height of your image. |
Example:
or
where
folder refers to the name of folder where you image is stored,
image refers to image name
format refers to type of image like jpg, png, gif, etc.
Now:
Result:
While the original width and height was:
By defining width and height, we controlled image’s height and width while by defining title you can scroll mouse over image and observe result and alt will replace image into defined text when browser or internet gets slow.
You can also use external source for your image. All you have to do is to insert proper link in value of src.
So, this is the most common and only way to insert image into HTML document. In our next lesson, we will learn how to make lists in HTML.
Load more comments