Iframe inline frame
Iframe is an HTML tag. It can embed the frame and content of a webpage in an existing webpage. That is to say, we can load other people's websites in our own webpage. Of course, some attributes of the iframe tag are also used by us. What we need to know about iframe, help us use it better.
Usage and attributes
Usage:
Use the iframe tag directly in the page
<iframe src="" frameborder="0"></iframe>
Attributes:
- src: the address of the imported page
- framedorder: Whether to display the frame, the attribute value has yes and no, yes means to display the frame, no means not to display
- name: frame identification name
- scrolling: Whether there is a scroll bar, the attribute values are yes, no, auto. yes means to display the scroll bar, and no means not to display the scroll bar. auto is to automatically adapt to the size of the window.
- width: Define the width of the iframe, you can use px to adjust it, you can also use a percentage%
- hight: Define the height of the iframe, you can use px to adjust, you can also use percentage%
- noresize: Whether to allow adjustment of the frame window size
- algin: According to the alignment of surrounding elements
Let's take a look at how it is used.
1. Use nesting directly on the page
```html
<iframe src="http://www.baidu.com" frameborder="0" width="60%" height="500px" scrolling="auto">
</iframe>
2. Used in conjunction with a tag
<p><a href="http://www.baidu.com" target="right-frame">百度</a></p>
<p><a href="http://qq.com" target="right-frame">腾讯</a></p>
<iframe src="http://qq.com" name="right-frame" width="400px" height="300px">
</iframe>
At this point, click on the hyperlink of Baidu to jump to the page.
These two pages can be simply jumped.