Anchor tag and IMG tag
Questions 1. Define <img> tag and src attribute.
Answer :- The <img> tag is used to embed an image in an HTML page.
Images are not technically inserted into a web page; images are linked to web pages. The <img> tag creates a holding space for the referenced image.
The <img> tag has two required attributes:
• src - Specifies the path to the image
• alt - Specifies an alternate text for the image, if the image for some reason cannot be displayed
Example:- <img src=”img_girl.jpg” alt=”Girl in a jacket” width=”500” height=”600”>
Questions 2:- Differences between gif and jpeg .
Answer:- The difference between GIF and JPEG is that GIF is a better choice for computer graphics with limited color palettes (like logos, simple cartoons, or line art), while JPEG is a better format for photographs and colorful images, and it also looks good when printed.
The extension of gif is .gif
The extension of jpeg is .jpeg
Questions3:- what is hyperlink?
Answer:- A hyperlink can be thought of as an interface that links a source to a target. Clicking the hyperlink at the source will navigate to the target. Hyperlinks can assume any of the following appearances:
Questions 4:- How to link a document?
Answer:- The HTML <a> tag defines a hyperlink. Anchor tag is use to link a document with text.It has the following
syntax: <a href=”url”>link text</a>
The most important attribute of the <a> element is the href attribute, which indicates the link’s destination.
Questions 5:- what is the use of name attributes?
Answer:- The name attribute specifies the name of an <input> element.
The name attribute is used to reference elements in a JavaScript, or to
Questions 6:- Define anchor tahg with href attribute.
Answer:- The <a> tag defines a hyperlink, which is used to link from one page to another.
The most important attribute of the <a> element is the href attribute, which indicates the link’s destination.
Example:- <a href=”www.google.com” > GOOGLE!</a>
Comments