html檔案裡引入檔案html檔案

來源:互聯網
上載者:User

標籤: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檔案

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.