iFrame HTML Basics
Reference Guide for basic HTML tags for iframes.
If you don't want to bother learning all of the below specifics, just go to our iFrame Generator and generate an iframe now.
Basic IFrame HTML
Bare minimum iframe code:
- Opening tag
- iframe page source
- height of the iframe
- width of the iframe
- Non-iframe content (What to display in the users' browser if they are not capable of viewing iframes.)
- Closing tag
Sample iFrame HTML
Below is a demonstration of two iframes. One with frameborders, and the other without. You can dynamically load different content by clicking on the two links below each frame. Page-2 is with a colored background so that you can easily see the boundaries of the iframe in the borderless example.
To direct a link to open inside of an iframe, the code is simple. You merely name the iframe, and then set the link as shown below. We have named our iframe "test". We then set the link to open in target="test".
Iframe with framebordersCode:
You need a Frames Capable browser to view this content.
page-1 | page-2 <--You can navigate by clicking on these links.
Iframe without framebordersCode: