Home > Web Front-end > HTML Tutorial > Detailed explanation of the use of HTML inline tag iframe!

Detailed explanation of the use of HTML inline tag iframe!

藏色散人
Release: 2022-08-05 11:12:39
forward
3595 people have browsed it

IframeInline frame

iframe is an HTML tag, which can embed the frame and content of a web page into an existing web page. That is to say, we can load other people's web pages in our own web pages. Website, of course, some attributes of the iframe tag are also what we need to know when using iframe to help us use it better. [Recommended: HTML video tutorial]

Usage and attributes

Usage:

Use the iframe tag directly in the page

 <iframe src="" frameborder="0"></iframe>
Copy after login

Attributes:

  • src: The address of the imported page
  • framedorder: Whether to display the border, the attribute values ​​​​are yes and no, yes means displaying the border, no means not Display
  • name: frame identification name
  • scrolling: whether a scroll bar appears. The attribute values ​​are yes, no, and auto. yes means to display the scroll bar, and no means not to display the scroll bar. auto automatically adapts to the size of the window.
  • width: Define iframe width, you can use px to adjust, or you can use percentage %
  • hight: Define iframe height, you can use px to adjust, you can also use percentage %
  • noresize: Whether to allow the frame window to be resized
  • algin: According to the alignment of surrounding elements

Let’s take a look at how it is used.

1. Use nesting

```html
  <iframe src="http://www.baidu.com" frameborder="0" width="60%" height="500px" scrolling="auto">
  </iframe>
Copy after login
directly on the page

Detailed explanation of the use of HTML inline tag iframe!

2. Use it in combination 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>
Copy after login

Detailed explanation of the use of HTML inline tag iframe!

At this time, click on the Baidu hyperlink to jump to the page

Detailed explanation of the use of HTML inline tag iframe!

These two pages can be easily jumped.

The above is the detailed content of Detailed explanation of the use of HTML inline tag iframe!. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template