1 Write about Tag or Element with example 2 What are the two
1. Write about <img> Tag or Element with example.
2. What are the two ways to specify a URL?
Solution
<img> tag in html is used for putting an image in an html document.
Below are the attributes used within the img tags:
height = represent the height of image in pixel or percentage
width = represent the width of image in pixel or percentage
src = the most important attribute of all it specifies the sorce or location of the image from which this image tag should be populated.
alt = alternative text which is used to display when the image is not loaded properly.
Examples:
above code will display the image a.png in the same path as index.html and if a.png is unable to load then alternate text will apper in place of this tag.
Two ways of specifying URL is :
we can use anchor tag to specify the location of the webpage.
the location of the webpage can be outside of the website or within the website.
To specify the location we make use of href attribute.
examples:
First way is to use absolute address:
<a href = \"www.a.com/aboutus.html\" />
above will point to www.a.com/aboutus.html
but let say if we are creating this link within a.com then we can specify relative addressing which is the second way
<a href = \"/aboutus.com\" />
