<img>: HTML Class Notes

Updated: Aug 17

Mobiprep has created last-minute notes for all topics of HTML to help you with the revision of concepts for your university examinations. So let’s get started with the lecture notes on HTML.

  1. HTML Introduction

  2. HTML Tags and Elements

  3. Attributes and Hyperlinks

  4. Headings and Lists

  5. Class and id attributes

  6. Semantic Elements

  7. Inline and Block-Level Elements

  8. Div and Span

  9. Img

  10. Tables

  11. Forms

Our team has curated a list of the most important questions asked in universities such as DU, DTU, VIT, SRM, IP, Pune University, Manipal University, and many more. The questions are created from the previous year's question papers of colleges and universities.

  1. What attributes can be used with <img> tag?

  2. Which HTML tag is used to insert images in a webpage? Explain it in detail.

  3. Mention the purpose of alt attribute in <img> tag.

  4. How can images be used as Hyperlinks?

  5. Define image maps.


Img


Question- 1) What attributes can be used with <img> tag?

Answer: When you use <img> tag in HTML. The SRC part is called an attribute. There are lots of other attributes you can add to the IMG tag.


Here are the image attributes in HTML 5:

  • ALT

  • SRC

  • HEIGHT

  • WIDTH

  • USEMAP

  • ISMAP


 

Question- 2) Which HTML tag is used to insert images in a webpage? Explain it in detail.

Answer: HTML img tag is used to display image on the web page. HTML img tag is an empty tag that contains attributes only, closing tags are not used in HTML image element.

 

Question- 3) Mention the purpose of alt attribute in <img> tag.

Answer: The required alt attribute specifies an alternate text for an image, if the image cannot be displayed. The alt attribute provides alternative information for an image if a user for some reason cannot view it.

 

Question- 4) How can images be used as Hyperlinks?

Answer: Creating an Image Link is almost the same as creating a text Link. You can create an Image Link by substitute an image tag in the place of the link text.


Consider the above text link and we are going to replace the link text

<a href=”url”><img src=”demo.png” alt=”image-as-a-link”/></a>

 

Question- 5) Define image maps.

Answer: The HTML <map> tag defines an image map. An image map is an image with clickable areas. The areas are defined with one or more <area> tags.

 







3 views0 comments

Recent Posts

See All