HTML Iframes are used to show the webpage inside a webpage. This is useful when you don’t want to develop the same page inside other pages. The basic syntax of the iframe is:
Syntax
1 2 3 |
<iframe src="put target url"> An alternate text to will show if the browser do not supports iframes. </iframe> |
Example
The src attribute is used to get the url from where iframes takes the webpage. This webpage is used to display in the decided location using iframe.
Test it Live
1 2 3 |
<iframe src="html-formatting" width="100%" height="200"> This is text to show if the borwser does not support iframes </iframe> |
Output
HTML iframes tag attributes are listed below
Sr. No. | attributes names | Description |
---|---|---|
1 | src | Include the target url of webpage to show to content of webpage. |
2 | width | Define the width of iframe element in the webpage. |
3 | height | This can be used to give the height of the iframe. |
4 | name | Naming of iframe can be define with this attribute. |
5 | frameborder | A frameborder is used to give border of the iframe. |