1. Iframe definition and usageIframes are generally used to include other pages. For example, we can load content from other people's websites on our own website pages. For better results, we may need to make the iframe transparent. Then we need to know more iframe attributes. Here is a simple compilation to facilitate friends who need it.
The iframe element creates an inline frame (i.e., an inline frame) containing another document.
Differences between HTML and XHTML
In HTML 4.1 Strict DTD and XHTML 1.0 Strict DTD, the iframe element is not supported.
Tips and comments:
Tip: You can place the required text between <iframe> and </iframe> so that you can deal with browsers that cannot understand the iframe.
iframe tags appear in pairs, starting with <iframe> and ending with</iframe>
Content in the iframe tag can be displayed when the browser does not support the iframe tag.
property
Example
The code is as follows:
<iframe src=http://www.vevb.com width=200 height=500>
Script Home uses framework technology, but your browser does not support frameworks. Please upgrade your browser to access Script Home normally.
</iframe>
Use pixels to define the iframe frame size
The code is as follows:
<iframe src=http://www.baidu.com width=20% height=50%>
Script Home uses framework technology, but your browser does not support frameworks. Please upgrade your browser to access Script Home normally.
</iframe>
Define iframe frame size using percentage
2. Iframe transparent
In the <body> tag of transparentBody.htm file, I have added style=background-color=transparent. Through the following four IFRAME writing methods, I think you should have a clear understanding of the implementation of the transparent effect of the iframe background:
The code is as follows:
<IFRAME ID=Frame1 SRC=transparentBody.htm allowTransparency=true></IFRAME>
<IFRAME ID=Frame2 SRC=transparentBody.htm allowTransparency=true STYLE=background-color: green> </IFRAME>
<IFRAME ID=Frame3 SRC=transparentBody.htm></IFRAME>
<IFRAME ID=Frame4 SRC=transparentBody.htm STYLE=background-color: green> </IFRAME>
Iframes are forced to be used because using iframes will bring more problems, and some browsers can set iframes to block them as ads.
I used iframes in a recent work content. The problem I encountered at the beginning was the problem of iframe being highly adaptable. This problem was found in the blog of the ued team of Kouwang.com. Later, I encountered an iframe transparent problem.
Usually the background color of the iframe will be white, and there may be different colors under different browsers.
If the main page has an overall background color or background picture
A white block will appear in the iframe area, which is inconsistent with the main page, which requires the iframe to be transparent
Search for transparent iframes found solution
The code is as follows:
<iframe src=./ads_top_tian.html allowstransparency=true style=background-color=transparent title=test frameborder=0 width=470 height=308 scrolling=no></iframe>Of course the premise is that no color is set in the iframe page
[code]
Note: iframe transparency mainly uses allowtransparency=true style=background-color=transparent
<strong>3. Iframe adaptive height
</strong>Because the length is too long, you can move here to view
<a target=_blank href=http://www.vevb.com/vip/20767.html>http://www.vevb.com/vip/20767.html</a>
<strong>4. Output iframe ad code through js
</strong>[code]
document.write('<iframe align=middle marginwidth=0 marginheight=0 src=http://www.vevb.com/vip/24902.html frameborder=no scrolling=no width=660 height=80></iframe>');