Explore 100's Of Free Video Tutorials

Keep Learning, Keep Coding & Keep Sharing

Adding images


html img tag:
img tag is a unpaired tag.
img tag is a inline tag.

img tag has various attributes like: src, width, height, title, alt, border.

src attribute indicates the source, source image name or full path of the source image is given as a value to src attribute.
width attribute is used to set the width of the image.
height attribute is used to set the height of the image.
title attribute: when we mouse over the image the value given to the title attribute is displayed as a tool tip.
border attribute used to set the border to image.
alt attribute is used to give an alternate name to the image, when source image is not available at specified location then alternate text will get display in place of the image.

Interview Questions:

1. Which HTML tag is used to display a picture?
a. picture
b. image
c. img
d. src
Answer: c

2. if an image could not be loaded, then which of the following attribute is used with HTML img tag to display an alternative text?
a. title
b. name
c. alt
d. description
Answer: c

3. URL stands for __________________________
a. Uniform Resource Language
b. Uniform Resource Loader
c. Uniform Reset Locator
d. Uniform Resource Locator
Answer: d

4. JPEG full form is _________________________
a. Joint Pictures Experts Graph
b. Joint Photographic Experts Group
c. Joint Pictures Experimental Group
d. Joint Pictures Experimental Graph
Answer: b