Tuesday, 23 January 2018

Frameset in HTML

Frameset
HTML frames are used to divide your browser window into multiple sections where each section can load a separate HTML document. A collection of frames in the browser window is known as a frameset. The window is divided into frames in a similar way the tables are organized: into rows and columns. There are few drawbacks with using frames, so it's never recommended to use frames in your WebPages-
  • Some smaller devices cannot cope with frames often because their screen is not big enough to be divided up.
  • Sometimes your page will be displayed differently on different computers due to different screen resolution.
  • The browser's back button might not work as the user hopes.
  • There are still few browsers that do not support frame technology.
Cols
Specifies how many columns are contained in the frameset and the size of each column. You can specify the width of each column in one of the four ways −
  • Absolute values in pixels. For example, to create three vertical frames, use cols = "100, 500, 100".
  • A percentage of the browser window. For example, to create three vertical frames, use cols = "10%, 80%, 10%".
  • Using a wildcard symbol. For example, to create three vertical frames, use cols = "10%, *, 10%". In this case wildcard takes remainder of the window.
  • As relative widths of the browser window. For example, to create three vertical frames, use cols = "3*, 2*, 1*". This is an alternative to percentages. You can use relative widths of the browser window. Here the window is divided into sixths: the first column takes up half of the window, the second takes one third, and the third takes one sixth. 
Rows
As relative widths of the browser window. For example, to create three vertical frames, use cols = "3*, 2*, 1*". This is an alternative to percentages. You can use relative widths of the browser window. Here the window is divided into sixths: the first column takes up half of the window, the second takes one third, and the third takes one sixth.

Eg:-<html>
<frameset cols="25%,*,25%">
  <frame src="frame_a.html">
  <frame src="frame_b.html">
  <frame src="frame_c.html">
</frameset>
</html>

Eg:- <!DOCTYPE html>
<html>
   <head>
      <title>HTML Frames</title>
   </head>
<frameset rows = "20%,60%,20%">
      <frame name = "top" src = "frame_a.html" />
      <frame name = "main" src = "frame_b.html" />
      <frame name = "bottom" src = "frame_c.html" />
         <noframes>
         <body>Your browser does not support frames.</body>
      </noframes>
         </frameset>
   </html>

a. <html>
<body bgcolor="pink">
<h1>Frame A</h><br>
<u>Note:</u><i>The frameset, frame, and noframes elements are not supported in HTML5.</i>
</body>
</html>

b. <html>
<body bgcolor="green">
<h1>Frame B</h><br>
<u>Note:</u><i>The frameset, frame, and noframes elements are not supported in HTML5.</i>
</body>
</html>

c. <html>
<body bgcolor="yellow">
<h1>Frame c</h><br>
<u>Note:</u><p>The frameset, frame, and noframes elements are not supported in HTML5.</p>
</body>
</html>

0 comments

Post a Comment