標籤:include rip scrolling get 檔案 比較 利用 utf-8 over
匯入通用的代碼除了使用php外 iframe在很多介面使用起來比較方便
比如說要寫導航 在好幾個介面都要用這個導航 可以用iframe引用
執行個體:這個header.html是我寫的一個導航介面
在index.html裡:
<div class="iframe">
<iframe src="header.html" width="100%" height="442px" marginwidth="0" frameborder="no" scrolling="no"></iframe>
</div>
2 簡單介紹一下利用php引入
eg:
<?php include("header.php"); //匯入導覽列 ?>
在header.php檔案裡正常使用html檔案的編寫即可
下面給出一個demo
header.php
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{text-align: center;}
a{color: red;}
a:hover{color: green;}
</style>
</head>
<body>
<h2>商品資訊管理</h2>
<a href="index.php">瀏覽商品</a> |
<a href="add.php">添加商品</a>
<hr width="80%" />
</body>
</html>
3 、<object>方式
<object style="border:0px" type="text/x-scriptlet" data="import.htm" width=100% height=30></object>
轉載請註明出處 謝謝合作*_*http://www.cnblogs.com/simba-lkj/p/6031662.html
html檔案裡引入檔案html檔案