网站建设使维护更容易

时间:2013-06-19 07:33:43

标签: html css web

我需要根据当地公司的要求建立一个网站。这是一家拥有广泛产品的公司。他们把所有这些都放在网上。因此,我将确保建立网站,以便之后可以轻松维护。

那么,有没有办法让您的导航,页眉和页脚得到修复?因为,有时他们会在他们的分类中添加一种新的产品,所以我不需要更改所有页面中的导航?

我只使用html / css,因为这是我学习ATM的唯一基础知识。

请帮忙。 THX

2 个答案:

答案 0 :(得分:1)

你可以用html / css制作你的网站没问题。但是你可以添加一些php来包含你的页眉和页脚:

<html>
<head>

    <title>Your Title</title>

</head>

<body>
<?php include('header.php'); ?> // this is your header. You can include it on every page.

<?php include('home.php'); ?> // this is your homepage. You can change this to for example: about me, products, categories, contact. etc

<?php include('footer.php'); ?> // this is your footer. you can add it on everypage by using this comment. just like the header.

</body>
</html>

然后在你的home.php中,你就像你一直做的那样制作一个html页面。 PHP包括文档here

您还可以使用Require,info here

希望你能得到它。这真的很有帮助!

答案 1 :(得分:1)

使用PHP即可完成此操作。您必须为标题创建一个文件,然后在您的html页面中说“header.php”,您必须这样做: -

main.php: -

<html>


<head>

</head>

<body>
<?php include('header.php'); ?>

/* Rest of your html code */


<?php include('footer.php'); ?>
</body>

</html>

header.php: - 它将包含您的所有标题HTML部分

footer.php: - 它将包含您的所有页脚HTML部分

主页:它将包含您的主容器。在这里你必须包括header.php和footer.php文件

您必须在每个文件中包含header.phpfooter.php

另外,请确保您必须使用扩展名.php

创建文件

您可以从HERE

学习PHP