Frames:
We can divide a web page into frames and each frame can display other web
pages.
There are only two main frame tags.
(1) <frameset></frameset> (2) <frame />
Example:
<html>
There are only two main frame tags.
(1) <frameset></frameset> (2) <frame />
Example:
<html>
<head>
<frameset cols="50%, 50%" >
<frame
src="a.html" />
<frame
src="b.html" />
</frameset>
</head>
<head>
<frameset rows="10%,20%,30%,15%,25%" >
<frame
src="a.html" />
<frame
src="b.html" />
<frame
src="c.html" />
<frame
src="d.html" />
<frame
src="e.html" />
</frameset>
</head>
<head>
<frameset cols="50, * , 2* " >
<frame
src="a.html" />
<frame
src="b.html" />
<frame
src="c.html" />
</frameset>
</head>
</html>
Note : We cannot add body on a framed page.
We can also define frames under a frame.
Example:
<html>
Note : We cannot add body on a framed page.
We can also define frames under a frame.
Example:
<html>
<head>
<frameset cols="50, * , 2* " >
<frame
src="a.html" />
<frame
src="b.html" />
<frameset
rows="*,*" >
<frame
src="c.html" />
<frame
src="d.html" />
</frameset>
</frameset>
</head>
<head>
<frameset cols="*, *" rows="*,*"
>
<frame
src="a.html" />
<frame
src="b.html" />
<frame
src="c.html" />
<frame
src="d.html" />
</frameset>
</head>
</html>
Other
attributes of <frameset > </ frameset > tag:
Border:
Specifies width of frame border.
bordercolor: specifies color for the border of frame.
Other attributes of <frame /> tag:
Scrolling: specifies scrollbars will be provided by browser or not. Possible values for this attribute are yes, no, auto.
noresize: This is a property and specifies that frame cannot be resized.
name: this attribute specifies name of the frame.
Example:
<html>
bordercolor: specifies color for the border of frame.
Other attributes of <frame /> tag:
Scrolling: specifies scrollbars will be provided by browser or not. Possible values for this attribute are yes, no, auto.
noresize: This is a property and specifies that frame cannot be resized.
name: this attribute specifies name of the frame.
Example:
<html>
<head>
<frameset cols="50, *, 2*"
border="15" bordercolor="#00FFFF">
<frame
src="a.html" noresize/>
<frame
src="b.html" scrolling="no" />
<frame
src="c.html" />
</frameset>
</head>
</html>
Linking between frames:- We can link pages between frames i.e. when we click on a hyperlink the linked page is opened in another frame.
We have to specify name property in the frame tag to do this and then specify this name in target attribute of hyperlink.
Example::
Left.html :-
<html>
Linking between frames:- We can link pages between frames i.e. when we click on a hyperlink the linked page is opened in another frame.
We have to specify name property in the frame tag to do this and then specify this name in target attribute of hyperlink.
Example::
Left.html :-
<html>
<body bgcolor="yellow"
text="red">
<h1>
Go to <a href="Link.html" target="RightFrame"> Link
Page </a> </h1>
</body>
<body bgcolor="red"
text="yellow">
<h1>
This is Right Page.</h1>
</body>
<body bgcolor="gray"
text="#00FFFF">
<h1>
This is Link Page.</h1>
</body>
<head>
<frameset
cols="30%,*" >
<frame
src="Left.html" name="LeftFrame" />
<frame
src="Right.html" name="RightFrame" />
</frameset>
</head>
</html>There are four target values in an <a> </a> tag:
_top: Opens a link in the full browser window.
_blank: Opens a link in a new browser window.
_self: Opens a link in same browser window or frame (same as doing nothing).
_parent: Opens a link in the immediate frameset parent.
No comments:
Post a Comment