Home | HTML | Asp.Net | HTML Probe | .Net Probe
   
 www.solvingera.com 
  Contact Us |Sitemap
  

Frames in HTML

Skip Navigation LinksHome>Html Home>HTML Frames

A Frame is an individual section of a Web Page. Each Frame section contains a separate HTML file. In simple words we can say that a Frame divides a web page into several panes where a user can reload content of each Frame instead of reloading the contents of the whole web page.

<frame> Tag

<frame> element is an empty element. It is not supported by HTML 5 version. All the major browsers like Google Chrome, Internet Explorer, Mozilla Firefox, opera, safari etc supports <frame> element. <frame> tag defines inside the <frameset> tag.

Some important attributes of <frame> element are given below.
  • Src : The Src attribute is used to define the URL of the page. For example - <frame src="URL1.htm" >.

  • frameborder : The frameborder attribute is used to set the border of the frame. Its value may be "1" or "0". By default its value is "1", it means a frameborder is on. For example:-<frame frameborder="1">.

  • name : The name attribute is used to declare a name for <frame> element. For example:-<frame name="FrameName">.

  • scrolling : The scrolling attribute specifies that the scroll up and down feature within the frame is ON or OFF or automatic. The possible values for scrolling attribute are yes or no or auto. For example:- <frame scrolling="auto">.

  • marginheight : The marginheight attribute is used to set the space between the content and top frame border and bottom frame border. Its value is in pixels. For example:-<frame marginheight="6">

  • marginwidth : The marginwidth attribute is used to set the space between the content and right frame border and left frame border. Its value is in pixels. For example:-<frame marginwidth="6">

  • noresize : The noresize attribute is used to disable the facility of resizing the frame.

<frameset> Tag

This tag is also not supported by HTML 5 version. It is a collection of <frame> element. The <frameset> tag replaces the <body> tag. In other words we can say that it is used instead of <body> tag.

Some important attributes of <frameset> element are given below.
  • rows : The row attribute is used to specifies the number of rows and the size of rows in a <frameset cols="*">. Its value may be in pixels or in percentage(%) or "*"(it means that it takes the remaining space).
    For example:– <frameset rows="30%,40%,30%">. It means that there are three rows in a frameset containing the 30%, 40% and 30% space of the available space in the frameset.

  • Cols : The cols attribute is used to specifies the number of columns and the size of columns in a <frameset>. Its value may be in pixels or in percentage(%) or *. "*" means that it takes the remaining space.
    For example:– <frameset cols="30%,40%,30%">. It means that there are three columns in a frameset containing the 30%, 40% and 30% space of the available space in the frameset.
A Sample code snippet for column.

 <html>

  <frameset cols="30%, 40%, 30%">

   <frame src="url1.htm">

   <frame src="url1.htm">

  </frameset>

 </html>

A Sample code snippet for rows.

 <html>

  <frameset cols="30%, 40%, *">

   <frame src="url1.htm">

   <frame src="url1.htm">

  </frameset>

 </html>
  
DMCA.com Protection Status
Design & Maintain By solvingera group| solvingera.com © 2013-2014 | all right reserved |Privacy Policy | Back to top