html--frameset、frame

8月5日

已被拋棄的框架frameset,必須放在body之外。

垂直和水平框架:

<frameset cols="30%,70%”>

或者是<frame rows="60%,40%">

 //將整個頁面分爲兩部分,鏈接的網址的頁面各佔,cols爲列,rows爲行。

<frame src="http://www.baidu.com"></frame>

<frame src="http://www.lol.qq.com"></frame>

</frameset>

混合一行二列框架:

<frameset rows="60%,40%">

<frame src="">

<frameset cols="30%,70%”>

<frame src="">

<frame src="">

</frameset>

</frameset>

      標籤<noframe>

<noframe>

<body>

當前瀏覽器不支持

</body>

</noframe>


導航框架:從一個框架鏈接到另一個框架

主結構:

<frameset cols="120,*">

    <frame src="contents.html">
    <frame src="a.html" name="showframe">

</frameset>
contents.html

<body>
    <a href="a.html" target="showframe">Frame1</a>
    <br>
    <a href="b.html" target="showframe">Frame2</a>

</body>
a.html

<body bgcolor="aqua">
<h3>Frame1</h3>

</body>
b.html同上。

圖:



在做的時候出現一個問題:當我content.html用<ul>時,google和IE瀏覽器都不能正確顯示這個功能。


框架導航跳到指定的節,錨點上

主框架

<frameset rows="30%,70%">
    <frame src="http://www.baidu.com">
    <frameset cols="40%,60%"  >
        <frame   src="main.html" >
        <frame   src="menu.html" name="main">
    </frameset>
</frameset>

main.html

<a  href="menu.html #one" target="main">第一章</a>
<a  href="menu.html #two" target="main">第二章</a>
menu.html

<h2><a name="one">第一章  北靈院</a></h2>
<p>
一大段話
</p>
<h2><a name="two">第二章  北靈院記錄卡上的</a></h2>
<p>
一大段話
</p>
圖:



出現的問題:這個功能顯示不能再chrome顯示,只能在IE中顯示。

在chrome中當點擊時會下載文件。。。。。。。。

1、frame的屬性

<frame  frameborder="0/1是否顯示邊框"、noresize="noresize 無法調整框架的大小" 

scrolling=“yes、no、auto滾動條是否顯示”>

</frame>

2、iframe懸浮框架

<iframe src="圖片或html文檔或其他" height="" width=""  frameborder=" 0/1框架邊框"  scrolling="yes/no/auto滾動條" 

>

</iframe>

以上所用測試瀏覽器爲IE9和chrome52.0.2743.82 m





發佈了42 篇原創文章 · 獲贊 11 · 訪問量 8萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章