Hello, world!

Frames HTML

HTML frames will help you to enhance your website in simple and fast method. Learning HTML frames in the HTML tutorial will taught you to present documents in multiple views.



HTML Frames

The HTML <frameset> element allows you to split your browser window into multiple views or frames where each frame element can load a separate HTML document.
In order to validate webpage with frames, it should set to a special frameset-specific doctype the <!DOCTYPE> should set such as  "HTML Frameset DTD" or "XHTML Frameset DTD.
HTML5 does not support the <frameset> tag.

Building Frames

The frameset takes the place of the body element so you should apply the <frameset> tag in replace of the <body> tag.
The rows and cols attributes specify the dimensions of each frame in the set.
The rows attribute specifies the height of each row and the cols attribute defines the width of each column.

HTML code example building frames:

<frameset rows="10%,80%,10%">
  <frame name="top" src="frame_a.htm">
  <frame name="middle "src="frame_b.htm">
  <frame name="bottom "src="frame_c.htm">
</frameset>


The <frame>, <iframe> Tag Attributes

marginwidth - Lets you set the width of the space between the sides of the frame's borders and its content.
marginheight - Lets you set the height of the space between the top and bottom of the frame's borders the frame's content.
src – Lets you indicates the file name or URL of page that should be fill in the frame.
name - Lets you indicate the name of a frame so that you can open new pages in specific frames.
noresize - Stops the user from being able to resize the frame as they want.
scrolling - Lets you control the behaviour of the scrollbars that appear on the frame.
longdesc - Lets you give a link to another page including a long description of the contents of the frame.
frameborder – Lets you indicate whether the frame must have a border or not.

The <frameset> Tag Attributes

border- Indicates the width of each frame’s border in pixels.
frameborder - Indicates whether a border should be presented around a frame on your page.
framespacing - Indicates the number of space between frames in a frameset. You can indicate the amount of space in any integer value.
cols - Indicates the size and number of columns contained in the frameset and the size of each column. You can indicate the width of each column in pixels, percentage of the browser window, using a wildcard symbol and as relative widths of the browser window.
rows - Indicates the size and number of rows contained in the frameset and the size of each rows. You can indicate the height of each row in pixels, percentage of the browser window, using a wildcard symbol and as relative widths of the browser window.

Frame's name and target attributes

The most common use of frames is putting up navigation bars in one frame and then loads main pages into a different window.

The target tattribute:
_blank - This will load content in a new window or tab
_self - This will load content in the same frame ( this is the default)
_top – This will load content in the full body of the window
_parent - This will load content in the parent frame
targetframe – This will load content in a specific targetframe


HTML code example frame's name and target attributes:

<!DOCTYPE html>
<html>
<head>
<title>HTML Target Frames</title>
</head>
<frameset cols="35%,65%">
   <frame src="https://drive.google.com/uc?id=0B3wdKlA6ta9rdFBjWDNLMExBRkU" name="menu_page" /> // The location of your menu page
   <frame src="http://ny.pe/images1/LoggaNYPE3.png" />
   <noframes>
   <body>
      Your browser does not support frames.
   </body>
   </noframes>
</frameset>
</html>

HTML output frame's name and target attributes:

HTML Target Frames // The location of your menu page <body> Your browser does not support frames. </body>
Below is the content of menu.htm file

HTML code example frame's name and target attributes:

<!DOCTYPE html>
<html>
<body bgcolor="#4a7d49">
<a href="http://www.google.com" target="main_page">Google</a>
<br /><br />
<a href="http://www.microsoft.com" target="main_page">Microsoft</a>
<br /><br />
<a href="http://news.bbc.co.uk" target="main_page">BBC News</a>
</body>
</html>