我爱Aspx >> Asp.Net >> 用CSS构建iframe效果iframe应用很普遍,通常的需求有两种:
1. 获取iframe效果,就是带一个滚动条,可以省不少版面。
2. 要嵌一个页面,实现框架链接。
如果不方便使用iframe,可以有如下相应解决方案:
1. 可以使用css布局来实现,即可以少一个页面,也可以提高执行效率。
2. 可以采用xmlhttp远程获取数据。
A. 直接模拟iframe
用层做容器
程序代码
#content { overflow:auto; height:200px; width:600px; background:#f00;}
效果演示:http://www.rexsong.com/blog/attachments/200601/02_150246_cssiframe1.htm
用body做容器
程序代码
html { overflow:hidden; height:100%; background:#fff; border:0;}
* html { padding:100px 0 0 100px;}
body { overflow:scroll; background:#f00; margin:0; position:absolute; top:100px; left:100px; bottom:0; right:0;}
* html body { height:100%; width:100%;}
效果演示:http://www.rexsong.com/blog/attachments/200601/02_151517_cssiframe2.htm
B. 绝对定位模拟iframe
滚动条在外边
程序代码
html { overflow:hidden; border:0; height:100%; max-height:100%;}
Ҷƪл˵?
AjaxHelper Flat v0.7 下载[05-20]
ISAPI精彩编程[05-20]
如何从Html页面中提取所有汉字,不..[05-20]
Access转SqlServer的注意事项[05-20]
叶子asp分页类(版本0.12.2005111..[05-20]
搜索引擎优化策略[05-20]
简单了解.NET中的动态编译机制[05-20]
深入研究Asp.net页面的生命周期[05-20]
asp.net 2.0中扩展login控件[05-20]
小日子过的——买了电脑[05-20]