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的源页面中设置body标签样式和在IFrame标签中使用allowTransparency属性,实现IFrame背景透明的效果。文章提供了具体的HTML代码示例。
1639

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



