HTML <iframe> ਟੈਗ
Definition and Usage
<iframe>
The tag defines an inline frame (inline frame).
Inline frames are used to embed another document within the current HTML document.
Tip:Use CSS to set <iframe>
styles (see the example below).
Tip:It is best to always use <iframe>
Contains the title attribute. Screen readers can use this attribute to read about <iframe>
Description of content.
See also:
HTML Tutorial:HTML Iframe
HTML DOM Reference Manual:IFrame Object
Example
Example 1
Inline frame tag as follows:
<iframe src="https://www.codew3c.com" title="CodeW3C.com Online Tutorial"></iframe>
例子 2
添加并删除 iframe 的边框(使用 CSS):
属性
属性 | 值 | 描述 |
---|---|---|
allow | 规定 | |
allowfullscreen |
|
如果 |
allowpaymentrequest |
|
如果允许跨源 |
height | ਪਿਕਸਲ | ਹੁੰਡੂ <iframe> ਦੀ ਉਚਾਈ ਨੂੰ ਨਿਰਧਾਰਿਤ ਕਰੋ। ਮੂਲ ਉਚਾਈ 150 ਪਿਕਸਲ ਹੈ। |
loading |
|
ਨਿਰਧਾਰਿਤ ਕਰੋ ਕਿ ਬਰਾਉਜ਼ਰ ਹੁੰਡੂ iframe ਨੂੰ ਤੁਰੰਤ ਲੋਡ ਕਰੇ ਜਾਂ ਕੁਝ ਸ਼ਰਤਾਂ ਪੂਰੇ ਹੋਣ ਤੱਕ ਲੋਡ ਨਾ ਕਰੇ। |
name | ਟੈਕਸਟ | ਹੁੰਡੂ <iframe> ਦਾ ਨਾਮ ਨਿਰਧਾਰਿਤ ਕਰੋ। |
referrerpolicy |
|
ਹੁੰਡੂ iframe ਨੂੰ ਲੈਂਦੇ ਸਮੇਂ ਭੇਜਣੀ ਹੋਣ ਵਾਲੀ ਸਬੰਧਤ ਸੂਚਨਾ ਨੂੰ ਨਿਰਧਾਰਿਤ ਕਰੋ। |
sandbox |
|
ਹੁੰਡੂ <iframe> ਵਿੱਚ ਸਮੱਗਰੀ ਲਈ ਇੱਕ ਲੜੀ ਦੇ ਅਤਿਰਿਕਤ ਸੀਮਾਂ ਚਾਲੂ ਕਰੋ। |
src | URL | ਨਿਰਧਾਰਿਤ ਕਰੋ ਕਿ <iframe> ਵਿੱਚ ਜਮ੍ਹਾਂ ਕੀਤਾ ਗਿਆ ਦਸਤਾਵੇਜ਼ ਦੀ ਠਿਕਾਣਾ। |
srcdoc | HTML ਕੋਡ | ਨਿਰਧਾਰਿਤ ਕਰੋ ਕਿ <iframe> ਵਿੱਚ ਕਿਸ ਪੰਨੇ ਦਾ HTML ਸਮੱਗਰੀ ਦਿਖਾਇਆ ਜਾਵੇ। |
ਚੌਦਾਈ | ਪਿਕਸਲ | ਹੁੰਡੂ <iframe> ਦੀ ਚੌਦਾਈ ਨੂੰ ਨਿਰਧਾਰਿਤ ਕਰੋ। ਮੂਲ ਚੌਦਾਈ 300 ਪਿਕਸਲ ਹੈ। |
ਗਲੋਬਲ ਵਿਸ਼ੇਸ਼ਤਾ
<iframe>
ਟੈਗ ਨੇ ਵੀ ਈਵੈਂਟ ਪ੍ਰਤੀਯੋਗਿਤਾ ਸਮਰਥਨ ਕਰਦੀ ਹੈ HTML ਵਿੱਚ ਗਲੋਬਲ ਪ੍ਰਤੀਯੋਗਿਤਾ.
HTML ਵਿੱਚ ਗਲੋਬਲ ਪ੍ਰਤੀਯੋਗਿਤਾ
<iframe>
ਟੈਗ ਨੇ ਵੀ ਈਵੈਂਟ ਪ੍ਰਤੀਯੋਗਿਤਾ ਸਮਰਥਨ ਕਰਦੀ ਹੈ HTML ਵਿੱਚ ਈਵੈਂਟ ਪ੍ਰਤੀਯੋਗਿਤਾ.
ਮੂਲਤਬੀ CSS ਸੈਟਿੰਗ
ਮੋਸਟ ਬਰਾਉਜ਼ਰਜ਼ ਨਾਲ ਹੇਠ ਲਿਖੇ ਮੂਲਤਬੀ ਮੁੱਲਾਂ ਵਰਤ ਕੇ ਪ੍ਰਦਰਸ਼ਿਤ ਕਰਦੇ ਹਨ <iframe>
ਅੰਗ:
iframe:focus { outline: none; } iframe[seamless] { display: block; }
ਬਰਾਉਜ਼ਰ ਸਮਰਥਨ
ਚਰੋਮ | ਐਜ਼ | ਫਾਇਰਫਾਕਸ | ਸੈਫਾਰੀ | ਓਪਰਾ |
---|---|---|---|---|
ਚਰੋਮ | ਐਜ਼ | ਫਾਇਰਫਾਕਸ | ਸੈਫਾਰੀ | ਓਪਰਾ |
ਸਮਰਥਨ | ਸਮਰਥਨ | ਸਮਰਥਨ | ਸਮਰਥਨ | ਸਮਰਥਨ |