HTML5中的iframe標籤
阿新 • • 發佈:2018-12-11
iframe元素會建立包含另外一個文件的內聯框架(即行內框架)。
src:src 屬性規定在 iframe 中顯示的文件的 URL;
name:設定該iframe的名字;
scrolling:scrolling屬性規定是否在 iframe 中顯示滾動條;
frameborder:frameborder屬性規定是否顯示 iframe 周圍的邊框;
srcdoc:srcdoc 屬性規定頁面的 HTML 內容顯示在行內框架中;
sandbox:sandbox屬性將會啟用一系列對行內框架中內容的額外限制。
<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8"> <style type="text/css"> .frame_left{ width:30%; height:500px; float:left; border:1px solid #000; } .frame_right{ width:60%; height:500px; float:left; margin-left:3%; border:1px solid #000; } </style> </head> <body> <div class="frame_left"> <div><a href="https://www.taobao.com" target="demo" >淘寶</a></div> <div><a href="https://www.baidu.com" target="demo" >百度</a></div> </div> <div class="frame_right"> <iframe src="http://baidu.com" name="demo" height="500" width="100% " frameborder=0 ></iframe> </div> </body> </html>