In this tutorial we will be looking at HTML Iframes. Iframes also known as inline frame is used to insert another web document to a section of a web page. HTML Iframes can be used to introduce customized menus, side bars, categories etc to a web page. The iframe tag <iframe> is not really that related to the frameset tag <frameset>. The HTML iframe introduces a section of the web page in which a browser can display a setting document such as scroll bars, menus.
Read previous tutorial on: Tutorial 15# Learn How To Create HTML Frames The Easy Way
The src attribute is used to link the URL of the web document to be linked to the iframe.
EXAMPLE SHOWN BELOW
<!DOCTYPE html> <html> <head> <title>HTML FRAME ILLUSTRATION</title> </head> <body> <p>TOP body showing the iframe section</p> <iframe src="/htmlimages/develoferd.html" width="49" height="51" > oops! browser doesnt suport iframes </iframe> <p>END body showing the iframe section</p> </body> </html>
RESULT ON WEB BROWSER
please note that this example is only for illustrative purpose. The URL linked to the HTML code isn’t a valid URL so no special web document was shown on the example but you have a view of the section that was kept for the external document.
The <Iframe> Tag Attributes
HTML Iframes comes with some attributes similar to that of
<frames> and this attributes are used to add special customization and property to the inline frames. List of the
<iframe> tag attributes are shown below
|src|| The src attribute is used to link the source URL of the inline frame. For example |
|name||This is used to give a name to a frame and allows the developer to assign a frame to a document. This is very important when you want create more than one links in one frame that loads up a document in another frame.|
|Frameborder||This is used to dictate weather the border of a frame is shown. Its values are in “0” or “1”. 0 means NO and 1 means YES.|
|marginwidth||This is used to specify the space in the left and right sides of the border between the border and content of the iframe|
|marginheight||This is used to specify the space in the top and bottom sides of the border between the border and content of the iframe|
|height||This attribute is used to specify the height of the iframe|
|width||This attribute is used to specify the width of the iframe|
Now you understand the basics of HTML IFRAMES and you are really doing great. Lets move on to the next tutorial on HTML BLOCKS