0% found this document useful (0 votes)
109 views15 pages

Module 8 Links

The document discusses HTML anchors and links. Anchors are used to define destinations within a document, while links allow navigation between documents. The <a> tag is used to define both anchors and links, with the href attribute specifying the link address and the name attribute creating in-page bookmarks. By default, unvisited links are underlined and blue, while visited links are underlined and purple. Images can also be used as links.

Uploaded by

Yumi kosha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views15 pages

Module 8 Links

The document discusses HTML anchors and links. Anchors are used to define destinations within a document, while links allow navigation between documents. The <a> tag is used to define both anchors and links, with the href attribute specifying the link address and the name attribute creating in-page bookmarks. By default, unvisited links are underlined and blue, while visited links are underlined and purple. Images can also be used as links.

Uploaded by

Yumi kosha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 15

Links

• Hyperlinks can point to any resource on


the web: an HTML page, an image etc.
• An anchor is a term used to define a
hyperlink destination inside a document.
• The HTML anchor element <a>, is used
to define both hyperlinks and anchors.

<a href="url">Link text</a>


The <a> tag defines an anchor. An
anchor can be used in two ways:

• To create a link to another document,


by using the href attribute
• To create a bookmark inside a
document, by using the name
attribute
By default, links will appear as follows
in all browsers:

• An unvisited link is underlined and


blue
• A visited link is underlined and purple
href attribute

• The href attribute defines the link


"address".

<a
href="http://www.w3schools.com/">Visit
W3Schools!
</a>
An image as a link

<html>
<body>
<p>
You can also use an image as a link:
<a href="lastpage.htm">
<img border="0" src="buttonnext.gif" width="65"
height="38">
</a>
</p>
</body>
</html>
An image as a link

<html>
<body>

<p>Create a link of an image:


<a href="default.htm">
<img src="smiley.gif" alt="HTML tutorial"
width="32" height="32" />
</a></p>

<p>No border around the image, but still a


link:
<a href="default.htm">
<img border="0" src="smiley.gif"
alt="HTML tutorial" width="32"
height="32" />
</a></p>

</body>
</html>
Frames
With frames, you can display more than one HTML
document in the same browser window. Each HTML
document is called a frame, and each frame is
independent of the others.

The Frameset Tag


• The <frameset> tag defines how to divide the window
into frames
• Each frameset defines a set of rows or columns
• The values of the rows/columns indicate the amount of
screen area each row/column will occupy

The Frame Tag


• The <frame> tag defines what HTML document to put
into each frame
Frameset Attributes

• Cols.(%) Defines the number and size of


columns in a frameset
• Rows. (%) Defines the number and size of
rows in a frameset
• Frameborder.(0 or 1) Specifies whether or
not to display border around the frame
Attributes for Frame

• Frameborder.(0 or 1) Specifies whether or not to


display border around the frame
• Scrolling.(Yes, No, Auto) Determines scrollbar
action
• Src. Defines the URL of the file to show in the
frame
• Name. Defines a unique name for the frame
• Noresize.(noresize) When set to noresize th(to
use in scripts)e user cannot resize the frame
Horizontal frameset

<html>

<frameset rows="25%,*,25%">
<frame src="frame_a.htm“ >
<frame src="frame_b.htm“ >
<frame src="frame_c.htm“ >
</frameset>

</html>
Vertical frameset

<html>

<frameset cols="25%,*, 25%"> Frame A Frame B Frame C

<frame src="frame_q.htm">
<frame src="frame_b.htm">
<frame src="frame_c.htm">
</frameset>

</html>
Mixed frameset

<html>

<frameset rows="50%,50%">
<frame src="frame_a.htm" />
<frameset cols="25%,75%">
<frame src="frame_b.htm" />
<frame src="frame_c.htm" />
</frameset>
</frameset>

</html>
Give the html code of the frames

Frame A Frame B Frame C

Frame D

Frame E

The 3 rows has a height of 30%, 30% and 40%.


The columns has a width of 30%, 40% and 30%.
<html>

<frameset rows = “ 30%, 30%, * ">


<frameset cols = “ 30%, *, 30% ">
<frame src="frame_A.htm" >
<frame src="frame_B.htm" >
<frame src="frame_c.htm" >
</frameset>
<frame src="frame_B.htm" >
<frame src="frame_c.htm" >
</frameset>

</html>

You might also like