HTML03: Images
Images are important eleemtn of a web site that enhance the appearance of a web page and appealing. To include images or pictures in web page <img> tag is used.
The src attribute of the <img> tag contains information in the form of url of the image.
for example,
this will produce following output
The original width and height of pic1.jpg is 140. The value of width and height are given in pixel. To set the size of the picture, we use attribute width and height.
for example.
output:
in examples given so far, the pic1.jpg is located in same folder as the html source code. Often in web sites, pictures will be stored in different location. Following example assumes pic1.jpg is stored in folder called images.
<img src = imageURL>
The src attribute of the <img> tag contains information in the form of url of the image.
for example,
<img src = "pic1.jpg">
this will produce following output
The original width and height of pic1.jpg is 140. The value of width and height are given in pixel. To set the size of the picture, we use attribute width and height.
for example.
<img src = "pic1.jpg" width = "200" height = "200">
output:
in examples given so far, the pic1.jpg is located in same folder as the html source code. Often in web sites, pictures will be stored in different location. Following example assumes pic1.jpg is stored in folder called images.
<img src = "/images/pic1.jpg">
Comments
Post a Comment