html-iframe_HTML iframe
html-iframe
iframe (Iframes)
In HTML, iframes are used to display a webpage inside another webpage.
在HTML中, iframe用于在另一個網頁內顯示一個網頁。
Syntax:
句法:
<iframe src="URL"></iframe>The <iframe> tag is used to define an iframe. And the src attribute is used to specify the location (URL) of the webpage that is to be included.
<iframe>標記用于定義iframe。 src屬性用于指定要包含的網頁的位置(URL)。
iframe廣告代碼屬性 (Iframe Tag properties)
Some of the common properties of the iframe are,
iframe的一些常見屬性是
i) height and width properties
i)高度和寬度屬性
The size of the iframe is defined in HTML using height and width properties.
iframe的大小是使用HTML的height和width屬性定義的。
Method 1: In HTML using height and width attribute, the default unit to define the values in pixels.
方法1:在使用height和width屬性HTML中,默認單位以像素為單位定義值。
<!DOCTYPE html><html><head> </head><body><h1>Iframes in HTML </h1><p>Example to define height and width in iframe</p><iframe src="https://www.includehelp.com/" width="500" heigth="200"></iframe> </body></html>Output
輸出量
Method 2: In CSS using height and width of iframe.
方法2:在CSS中使用iframe的高度和寬度。
<!DOCTYPE html><html><head> </head><body><h1>Iframes in HTML </h1><p>Example to define height and width in iframe</p><iframe src="https://www.includehelp.com/" style="height:400px; width:500px"></iframe> </body></html>Output
輸出量
ii) Iframe borders (The border property)
ii)iframe邊框(border屬性)
In iFrames, there is a default border around it. You can define the border for the iframe in HTML using CSS border property.
在iFrame中,它周圍有一個默認邊框。 您可以使用CSS border屬性為HTML中的iframe定義邊框。
<!DOCTYPE html><html><head> </head><body><h1>Iframes in HTML </h1><p>Example to define height and width in iframe</p><iframe src="https://www.includehelp.com/" style="border: 2px dotted green"></iframe> </body></html>Output
輸出量
<!DOCTYPE html><html><head> </head><body><h1>Iframes in HTML </h1><p>Example to define height and width in iframe</p><iframe src="https://www.includehelp.com/" style="border: none;"></iframe> </body></html>Output
輸出量
iii) Changing link in iframe
iii)在iframe中更改鏈接
In the iframe, the link can be changed for the iframe to the next link in an event. The attribute target and name are required.
在iframe中,可以將iframe的鏈接更改為事件中的下一個鏈接。 屬性目標和名稱是必需的。
The name attribute defines the name iframe whose link is to be redefined.
name屬性定義要重新定義其鏈接的名稱iframe。
The target attribute is defined in another tag with the same value as the name of the iframe and will be used to replace the src of the iframe.
target屬性是在另一個標簽中定義的,該標簽的值與iframe的名稱相同,并將用于替換iframe的src 。
<html><head> </head><body><h1>Iframes in HTML </h1><p>Example to replace link in iframe</p><iframe src="https://www.includehelp.com/" name="iframe1" width="500" height="450"></iframe><br><a href="https://www.includehelp.com/scala/" target="iframe1">Lets see my new article</a> </body></html>Output
輸出量
After cliking on the link...
點擊鏈接后...
翻譯自: https://www.includehelp.com/html/iframes.aspx
html-iframe
總結
以上是生活随笔為你收集整理的html-iframe_HTML iframe的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: vector cbegin_vector
- 下一篇: em算法示例_带有示例HTML'em'标