frame 和 iframe 的區別
1、frame 不能脫離 frameset 單獨使用,iframe 可以;
2、frame 不能放到body中,否則將無法顯示;
3、iframe 也可以嵌套在frameset ,但是必須放到body中,不嵌套在frameset 中的iframe 可以隨意使用;
4、frame 的高度只能通過 frameset 控制,iframe 是自己本身控制,不能通過 frameset 設置;
5、iframe 可以放到表格中;
frame 的基本用法
由於 frame 不能脫離 frameset 單獨使用,所以寫法還是有所不同
<!-- noresize: 規定無法調整框架的大小 frameborder: 規定是否顯示框架周圍的邊框 0為無邊框 1為有 marginheight: 定義框架的上方和下方的邊距 marginwidth: 定義框架的左側和右側的邊距 noresize: 規定無法調整框架的大小 scrolling: 規定是否在框架中顯示滾動條 yes no auto src: 規定在框架中顯示的文檔的 URL。 --> <!-- cols: 定義框架集中列的數目和尺寸 rows: 定義框架集中行的數目和尺寸 --> <frameset rows="30%,50%"> <frame src="frame_one.html" frameborder="0"> <frame src="frame_two.html" frameborder="0"> </frameset>
cols 是豎排顯示,rows 是橫排顯示。
<frameset cols="30%,50%"></frameset> 中的百分比是設置 frame 的尺寸。
The most terrible person in the world is yourself