Вы находитесь на странице: 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>

Вам также может понравиться