Reputation: 470
I'm new in php and html scripting, so I would like to know if someone could give me an advice about how to set up my page structure.
I need to create a page with an header and a footer, a left-page menu and a main section where the contents of the site are displayed.
I thought about a frameset like this:
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Frameset//IT” “http://www.w3.org/TR/html4/frameset.dtd”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1?>
<title>Framesets</title>
</head>
<frameset rows=”20%,70%,10%”>
<frame src=header.php>
<frameset cols=”20%,80%”>
<frame src=menu.php>
<frame src=main.php>
</frameset>
<frame src=footer.php>
</frameset>
<noframes></noframes>
</html>
When someone click on a link displayed on the menu.php section, only the main.php section will be called with different options (or I can call different php pages, one per choice), but I'm not sure this is the best solution, can anyone give me some advices?
(sorry for my english!)
Upvotes: 2
Views: 303
Reputation: 14983
you really don't need frames, maybe rather try something like this for this kind of page layout:
HTML
<header>
<?php include('header.php') ?>
</header>
<div class="main">
<nav>
<?php include('menu.php') ?>
</nav>
<div class="content">
<?php include('main.php') ?>
</div>
</div>
<footer>
<?php include('footer.php') ?>
</footer>
CSS
html, body{
height: 100%;
}
header{
height: 20%;
}
.main{
height: 70%;
}
footer{
height: 10%;
}
nav{
width: 20%;
height: 100%;
float: left;
}
Upvotes: 4
Reputation: 168803
No, it's not good.
The use of HTML framesets has been deprecated and is no longer valid in recent versions of HTML.
You can still use <iframe>
if you need this kind of feature, but in general what you're trying to do is a very very out-dated way of writing web pages.
Upvotes: 6