iframe页面(head.jsp)body标签中加入:style=background:transparent
home.jsp调用iframe页面iframe标签中加入:allowTransparency="true"如:
head.jsp
<html>
<body style="background:transparent">
hello,test!<!-- <iframe src="http://m.weather.com.cn/m/pn12/weather.htm" width="245" height="100" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" allowtransparency="true" scrolling="no"></iframe>-->
</body>
</html>
hom.jsp
<html>
<body style='background-color:#DFE8F6;'>
<iframe src="head.jsp" width="380" height="110" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" name="I2" allowtransparency="true" align="middle">
</iframe>
</body>
</html>
本文介绍如何通过在IFrame的源页面和宿主页面中设置特定属性,实现IFrame背景透明的效果。具体步骤包括在IFrame源页面的body标签中添加背景透明样式,并在宿主页面的IFrame标签中启用允许透明属性。
4739

被折叠的 条评论
为什么被折叠?



