In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use the HTML tag". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use the HTML tag".
What is the HTML tag:
The tag specifies an inline framework.
An inline framework is used to embed another document in the current HTML document.
How to use the HTML tag:
The tag creates an inline frame that contains another document, effectively embedding another HTML page into the current page. Please refer to the following example:
Tag an inline frame:
HTML tag attributes:
Tu1.png
Basic use of HTML tags:
Usage scenarios: most of the pages are the same, but a few are different. For example, in the system, the left_nav and top content of each page is the same, and the content at the bottom right is changing.
Advantages: increase the reuse rate of page code, let's be lazy.
Cons: the url address of the page has not changed.
Three highly adaptive methods for iframe:
Iframe content is unknown and highly predictable
At this point, we can add a default min-height value of CSS to it, and then change the height using JavaScript at the same time. Commonly used compatible codes are:
1. (set document.domain= "caibaojian.com" if the information is not exchanged between different subdomains under the same top-level domain name)
/ / document.domain= "caibaojian.com"
FunctionsetIframeHeight (iframe) {
If (iframe) {
VariframeWin=iframe.contentWindow | | iframe.contentDocument.parentWindow
If (iframeWin.document.body) {
Iframe.height=iframeWin.document.documentElement.scrollHeight | | iframeWin.document.body.scrollHeight
}}
}
_ window.onload=function () {
SetIframeHeight (document.getElementById ('external-frame'))
}
two。 An ID call to a known iframe:
Just modify the ID of the above iframe. Or you can write the code directly in iframe. We generally recommend using the above code in order not to pollute the HTML code.
3. Iframe with content width changes is highly adaptive:
FunctioniframeAutoFit (iframeObj) {
SetTimeout (function () {if (! iframeObj) return;iframeObj.height= (iframeObj.Document?iframeObj.Document.body.scrollHeight:iframeObj.contentDocument.body.offsetHeight);} 200)
}
4. Open the debug run window and you can see the run:
FunctionreinitIframe () {
Variframe=document.getElementById ("test")
Try {
VarbHeight=iframe.contentWindow.document.body.scrollHeight
VardHeight=iframe.contentWindow.document.documentElement.scrollHeight
Varheight=Math.max (bHeight,dHeight)
Iframe.height=height
Console.log (height)
} catch (ex) {}
}
Window.setInterval ("reinitIframe ()")
Prompt bar:
Tip: you can put the text you need between and, so you can deal with unsupported browsers.
Tip: use CSS to define styles for (including scroll bars).
Tip: tags are mainly used for common parts of multiple web pages, such as navigation bar, advertising bar, etc.
Differences between HTML4.01 and HTML5:
HTML5 adds some new properties and removes some attributes from HTML4.01.
Differences between HTML and XHTML:
In XHTML, the name attribute has been discarded and will be removed. Use the id property instead.
Thank you for your reading, the above is the content of "how to use the HTML tag". After the study of this article, I believe you have a deeper understanding of how to use the HTML tag, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.