濮阳杆衣贸易有限公司

主頁 > 知識(shí)庫 > 用CSS構(gòu)建iframe效果代碼

用CSS構(gòu)建iframe效果代碼

熱門標(biāo)簽:北川縣地圖標(biāo)注 武漢人工外呼系統(tǒng) 上古卷軸5地圖標(biāo)注mod 山西旅游景地圖標(biāo)注 移動(dòng)400辦理電話 中國地圖標(biāo)注各省份 沈陽智能外呼系統(tǒng)排名 荒野大鏢客2地圖標(biāo)注怎么變中文 蘇州通信外呼系統(tǒng)多少錢
iframe應(yīng)用很普遍,通常的需求有兩種:

1,獲取iframe效果,就是帶一個(gè)滾動(dòng)條,可以省不少版面。
2,要嵌一個(gè)頁面,實(shí)現(xiàn)框架鏈接。

如果不方便使用iframe,可以有如下解決方案:

第一種需求如果我們使用css布局來實(shí)現(xiàn),即可以少一個(gè)頁面,也可以提高效率。
第二種需求可以采用xmlhttp遠(yuǎn)程獲取。

A. 直接模擬iframe

用層做容器
#content { overflow:auto; height:200px; width:600px; background:#f00;}

效果演示源代碼:

[Ctrl+A 全選 注:引入外部Js需再刷新一下頁面才能執(zhí)行]

用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%;}
效果演示源代碼:

[Ctrl+A 全選 注:引入外部Js需再刷新一下頁面才能執(zhí)行]

B. 絕對定位模擬iframe

滾動(dòng)條在外邊
復(fù)制代碼 代碼如下:

html { overflow:hidden; border:0; height:100%; max-height:100%;} 
body { overflow:hidden; margin:0; height:100%; max-height:100%; position:relative;} 
#head { position:absolute; top:0; right:15px; width:100%; height:100px; background:#f00; z-index:2;} 
#foot { position:absolute; bottom:0; right:15px; width:100%; background:#f00; height:50px;z-index:2;} 
#content { height:100%; position:relative; z-index:1; overflow:auto;} 

效果代碼演示

[Ctrl+A 全選 注:引入外部Js需再刷新一下頁面才能執(zhí)行]

滾動(dòng)條在里邊
復(fù)制代碼 代碼如下:

html { height:100%; max-height:100%; border:0; overflow:hidden;} 
* html { padding:100px 0 50px 0;} 
body { height:100%; max-height:100%; margin:0; overflow:hidden;} 
#content { position:absolute; top:100px; bottom:50px; left:0; right:0; z-index:3; width:100%; overflow:auto;} 
* html #content { top:100px; bottom:0; height:100%;} 
#head { position:absolute; margin:0; top:0; left:0; width:100%; height:100px; background:#f00; z-index:5;} 
#foot { position:absolute; margin:0; bottom:0; left:0; width:100%; height:50px; z-index:5; background:#f00;} 

效果演示代碼:

[Ctrl+A 全選 注:引入外部Js需再刷新一下頁面才能執(zhí)行]

標(biāo)簽:濱州 陽泉 海東 邯鄲 東莞 南充 遼源 喀什

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《用CSS構(gòu)建iframe效果代碼》,本文關(guān)鍵詞  用,CSS,構(gòu)建,iframe,效果,代碼,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《用CSS構(gòu)建iframe效果代碼》相關(guān)的同類信息!
  • 本頁收集關(guān)于用CSS構(gòu)建iframe效果代碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    武夷山市| 大英县| 华安县| 广宗县| 洛阳市| 延寿县| 辽阳市| 山东| 宜州市| 伊金霍洛旗| 建瓯市| 永康市| 二手房| 合阳县| 和林格尔县| 成安县| 常熟市| 惠州市| 察隅县| 沂源县| 紫金县| 富源县| 教育| 勐海县| 华坪县| 济源市| 福州市| 南汇区| 黑龙江省| 塔城市| 东兰县| 太仆寺旗| 安国市| 开江县| 嘉祥县| 肃宁县| 乐平市| 昭通市| 天峻县| 呼和浩特市| 韶关市|