HTML – Frames By Dr. I. Uma Maheswari iuma_maheswari@yahoo.co.in
Frames • Html allows a significant feature of dividing the browser’s screen into different windows called Frames. • Frames are created using <frameset> …….</frameset> tag. • When this tag is used in the document, the <body> tag is not used. • It actually replaces <body> tag and hence formatting tags, hyperlinks or document text cannot be used in the frame definition.
Attributes of <frameset> tag 1. Cols • This attribute is used to divide the browser screen into number of vertical frames (columns). • A value is given to this attribute which is either in terms of pixels or percentage. • The advantage of using percentage is that when the size of the browser changes, these value will also change correspondingly. Eg., <frameset cols = “40%, 60%”> <frameset cols = “50%, 30%, * ”>
2. Rows • This attribute instructs the browser to spilt the screen into number of horizontal frames (rows). Eg., <frameset rows = “40%, 60%”> <frameset rows = “50%, 30%, * ”>
Frame tag • <frame> tag defines the contents and properties of an individual frame declared using the Frameset. • <frame> tag lies inside the frameset element. • <frame> tag does not contain an end tag.
Frame tag attribute • Name – This attribute assigns a specific name to a frame. • SRC – refers the html document to be displayed in the frame. Eg., <frame name = “firstname” src = “test.html”>
Example for frames <HTML> <HEAD> <TITLE> frames </TITLE> </HEAD> <frameset cols – “50%, *”> <frame src = “poem.html”> poem.html <frame src = “tree.html”> tree.html </frameset> </HTML>
Link between frames • TARGET attribute – is used with each link to specify the frame in which the linked document should be displayed. Eg., <HTML> <HEAD> <TITLE> frames </TITLE> </HEAD> <frameset cols – “60%, 40%”> <frame src = “main.html”> <frame sc = “side.html”> name = “secondframe”> </frameset> </HTML> Save this as frame.html
<HTML> <HEAD> <TITLE> main part </TITLE> </HEAD> <body> <H1>menu</h1> <UL> <LI> <A href = “poem.html” target = “secondframe”> <br><br> <LI> <A href = “tree.html” target = “secondframe”> </UL> </body> </HTML> Save the file as main.html

computer language - Html frames

  • 1.
    HTML – Frames By Dr.I. Uma Maheswari iuma_maheswari@yahoo.co.in
  • 2.
    Frames • Html allowsa significant feature of dividing the browser’s screen into different windows called Frames. • Frames are created using <frameset> …….</frameset> tag. • When this tag is used in the document, the <body> tag is not used. • It actually replaces <body> tag and hence formatting tags, hyperlinks or document text cannot be used in the frame definition.
  • 3.
    Attributes of <frameset>tag 1. Cols • This attribute is used to divide the browser screen into number of vertical frames (columns). • A value is given to this attribute which is either in terms of pixels or percentage. • The advantage of using percentage is that when the size of the browser changes, these value will also change correspondingly. Eg., <frameset cols = “40%, 60%”> <frameset cols = “50%, 30%, * ”>
  • 4.
    2. Rows • Thisattribute instructs the browser to spilt the screen into number of horizontal frames (rows). Eg., <frameset rows = “40%, 60%”> <frameset rows = “50%, 30%, * ”>
  • 5.
    Frame tag • <frame>tag defines the contents and properties of an individual frame declared using the Frameset. • <frame> tag lies inside the frameset element. • <frame> tag does not contain an end tag.
  • 6.
    Frame tag attribute •Name – This attribute assigns a specific name to a frame. • SRC – refers the html document to be displayed in the frame. Eg., <frame name = “firstname” src = “test.html”>
  • 7.
    Example for frames <HTML> <HEAD> <TITLE>frames </TITLE> </HEAD> <frameset cols – “50%, *”> <frame src = “poem.html”> poem.html <frame src = “tree.html”> tree.html </frameset> </HTML>
  • 8.
    Link between frames •TARGET attribute – is used with each link to specify the frame in which the linked document should be displayed. Eg., <HTML> <HEAD> <TITLE> frames </TITLE> </HEAD> <frameset cols – “60%, 40%”> <frame src = “main.html”> <frame sc = “side.html”> name = “secondframe”> </frameset> </HTML> Save this as frame.html
  • 9.
    <HTML> <HEAD> <TITLE> main part</TITLE> </HEAD> <body> <H1>menu</h1> <UL> <LI> <A href = “poem.html” target = “secondframe”> <br><br> <LI> <A href = “tree.html” target = “secondframe”> </UL> </body> </HTML> Save the file as main.html