user225269
user225269

Reputation: 10913

alternative to using frames in html

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.

Upvotes: 0

Views: 927

Answers (3)

Davide Muzzarelli
Davide Muzzarelli

Reputation: 989

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.

Upvotes: 2

53an
53an

Reputation: 171

Depending on what you wish to display you could look at using divs or using includes.

Upvotes: 0

Gabriele Petrioli
Gabriele Petrioli

Reputation: 196002

In regards to what you see in most websites, they just reuse the same code.. (usually in an external file and insert it in all their pages)..

Take a look at Server Side Includes for more info

Upvotes: 1

Related Questions