文章出處 : http://blog.sina.com.cn/s/blog_6f6d07f80100oqlt.html (本文轉自此博客)
在瀏覽網頁時,我們經常會看到一個導航條,當點擊導航條上的項目時,相應網頁會在顯示區域變換顯示。首先准備一個主界面文件main.htm,將其划分成兩塊區域index和content. <html> <frameset cols="120,*"> <frame name="index" src="index.htm" /> <frame name="content" src="frame_a.htm" /> </frameset> </html> 其中index區域鏈接index.htm文件,主要是一些鏈接項目;content區域負責顯示相應鏈接文件,初始顯示鏈接為frame_a.htm.
name="index"是標明index區域的屬性,name="content"是標明content區域的屬性。 那么如何將index.htm中的鏈接輸出到content區域顯示呢?這里需要設置鏈接中的target屬性。代碼如下: <html> <head> </head> <body> <a href="frame_a.htm" target="content">frame_a</a> <a href="frame_b.htm" target="content">frame_b</a> <a href="frame_c.htm" target="content">frame_c</a> </body> </html>
效果圖如下貼出:
文章出處 : http://blog.sina.com.cn/s/blog_6f6d07f80100oqlt.html (本文轉自此博客)