Hello guys,
I am back with by post…today it will be my last post on html 5, as this course
of html 5 will be finished today. So, what we studied in the previous post was
about html table tags….today we will learn about HTML Frame and Framesets. So,
we will be starting with:-
Creating Fames
To use frames on a page we
use <frameset> tag instead of <body> tag. The <frameset> tag
defines how to divide the window into frames. The rows attribute of <frameset>tag
defines horizontal frames and cols attribute defines vertical frames. Each
frame is indicated by <frame> tag and it defines which HTML document
shall open into the frame.
Example:
Example to create three
horizontal frames:
<!DOCTYPE html>
<html>
<head>
<title>HTML
Frames/title>
</head>
<frameset rows=”10%, 80%,
10%”>
<frame name=”top”
src=”/html/top_frame.htm” />
<frame name=”main”
src=”/html/main_frame.htm” />
<frame name=”bottom”
src=”/html/bottom_frame.htm” />
<noframes>
<body>
Your browser does not support
frames.
</body>
</noframes>
</frameset>
</html>
Let’s put above example as
follows, here we replaced rows attribute by cols and changed their width. This
will create all the three frames vertically:
<!DOCTYPE html>
<html>
<head>
<title>HTML
Frames/title>
</head>
<frameset cols=”25%, 50%,
25%”>
<frame name=”left”
src=”/html/top_frame.htm” />
<frame name=”center”
src=”/html/main_frame.htm” />
<frame name=”right”
src=”/html/bottom_frame.htm” />
<noframes>
<body>
Your browser does not support
frames.
</body>
</noframes>
</frameset>
</html>
The <Frameset> Tag Attributes
·
Cols- specifies
how many columns are contained in the frameset and the size of each column.
·
Rows- it is used
to specify the rows in the frameset.
·
Border- specifies
the width of the border of each frame.
·
Frameborder-
specifies whether a three-dimensional border should be displayed between
frames.
·
Framespacing-
specifies the amount of space between frames in a frameset.
The <frame> Tag Attributes
·
Src
·
Name
·
Frameborder
·
Marginwidth
·
Marginheight
·
Noresize
·
Scrolling
·
Longdesc
Frame’s name and target
Let’s see following example
where a test.htm file has following code:
<!DOCTYPE html>
<html>
<head>
<title>HTML
Target/title>
</head>
<frameset cols=”200, *”>
<frame
src=”/html/menu.htm”
name=”menu_page” />
<frame
src=”/html/main.htm”
name=”main_page” />
<noframes>
<body>
Your browser does not support
frames.
</body>
</noframes>
</frameset>
</html>
So, friends this was all for this post. My
next post will be a demo website. All the tags will be used in my website which
we have studied. You peeps also try and make some cool websites on the end of
this html 5 session. You can mail me the link of your respective websites…I
will be pleased to see that…thank you..
To Like Our Facebook Page > CLICK HERE!!!!
To follow us on Twitter > CLICK HERE!!!
To Subscribe Our Youtube Channel >CLICK HERE!!!!!
To follow us on Instagram > CLICK HERE!!!
Comments
Post a Comment