HTML Iframe is the section 13 of Beginner’s Guide to HTML.
If you want to display a web page within a web page, Iframe comes in handy. Iframe means inline frame. Commonly used in the situations like web pages for each item link on your menu. Syntax is like as follows.
So in the above code snippets it will display Disney website within your webpage inside of a frame.
Width and Height
You can also define the height and width of the frame either in pixels or as a percentage. If you are using an iframe for display each item on the menu, make sure to define correct width and height of the frame section.[code language=”html”]
Checkout what happens when the correct width and heights are not setted on a inline frame. You’ll see scroll bars around the iframe, horizontally and vertically. When you set the correct width and height, those scroll bars will goes away.
Using the frameborder attribute you can specify whether or not to display a border around the iframe. Use 0 value not to display a border. By default there will be a border.[code language=”html”]
Iframes can be used with links interconnected. You can specify on which iframe the url of the link should displayed. To do that you need to give a name for the iframe and that name should be refer in the target attribute of the link.[code language=”html”]
So in here when we click on the link Disney Website the web page of it will display on the targeted iframe my_iframe rather than your_iframe.
So in this section we came into know about iframes. Display inline web pages. In the next section we’ll do lot in colors in HTML.
Let’s learn about Using Colors in HTML.