在html中使用框架的替代方法 [英] alternative to using frames in html

查看:102
本文介绍了在html中使用框架的替代方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有其他选择使用框架。我只是一个初学者,我仍然不知道网页设计师在做什么。
几乎所有我看到的网站。保留页面中的标题。

使用服务器端语言,如 http://www.php.net/rel =nofollow noreferrer> PHP ,以便生成完整的HTML页面。



例如,创建三个文件:


  • header.php

  • page.php

  • footer.php



在header.php文件中,您必须放置HTML页面的第一部分。 >
在page.php文件中,您必须放置HTML页面的主要内容。

在footer.php文件中,与header.php一样,必须将末尾部分的HTML页面。

因此,您可以更改页面文件和页眉并保留页脚。



header.php:

 < html> 
< head>
< / head>
< body>
< div id =header>
在这里放置标题。
< / div>

page.php:

 <?php include('header.php'); ?> 
< div id =main_content>
将您的网页内容放在这里。
< / div>
<?php include('footer.php'); ?>

footer.php:

 < div id =footer> 
将脚注放在这里。
< / div>
< / body>
< / html>

有关更多信息,请使用Google搜索PHP教程。


Is there any alternative for using a frame. I'm just a beginner and I still don't know what the web designers are doing. Almost all of the websites I see. Retains the header in the page. How can I apply that so I can stop from using frames.

解决方案

Use a server-side language like PHP in order to generate a full HTML page.

For example, create three files:

  • header.php
  • page.php
  • footer.php

In the header.php file you have to put the first part of the HTML page.
In the page.php file you have to put the main content of the HTML page.
In the footer.php file, like the header.php, you have to put the end part of the HTML page.
So you can change the page file and the header and the footer remain.

header.php:

<html>
<head>
</head>
<body>
<div id="header">
Place your header here.
</div>

page.php:

<?php include('header.php'); ?>
<div id="main_content">
Place your page content here.
</div>
<?php include('footer.php'); ?>

footer.php:

<div id="footer">
Place your footer here.
</div>
</body>
</html>

For more information, search for a PHP tutorial with Google.

这篇关于在html中使用框架的替代方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆