You are on page 1of 3

1. Syntax for adding an HTML link.

• Links are specified in HTML using the “a” tag.


Eg. <a href=”url”>Text link</a>
<a href=”www.facebook.com”>Facebook</a>
• href : The href attribute is used to specify the
destination address of the link used. "href" stands
for Hypertext reference.
• Text link: The text link is the visible part of the link.

It is what the viewer clicks on.

2. Images as links
• The code is
<a href=”url to go to when image is clicked”>
<img src=”image address(online/offline)” alt=”alt.
Text(when image cannot be displayed)”
style=”width:__ ; height:__ ; border:__”>
</a>

• Note: img src stands for image source ( i.e URL or


file address )

3. Various possible values of the target attribute of


HTML link element.

• The HTML <link> target Attribute is used to


specify the window or a frame where the linked
document is loaded. It is not supported by HTML 5.

• Syntax:
<link target="_blank|_self|_parent|_top|
framename">
• Attribute Values:
• _blank: It opens the link in a new window.
• _self: It is the default value. It opens the linked
document in the same frame.
• _parent: It opens the linked document in the parent
frameset.
• _top: It opens the linked document in the full body
of the window.
• framename: It opens the linked document in the
named frame.
4. How to Insert an Image in HTML

The <img> tag specifies an image to be displayed in an


HTML document.

Syntax:
<img src="5.png" alt="image is not available"
width="120px" height="100px">

5. Image alignment in HTML


<img> align attribute is used to align the image.
Syntax:

<img align=”left|right|middle|top|bottom”>

You might also like