doupian6118 2012-07-24 21:10
浏览 137
已采纳

在html / php页面中使用框架集是好的吗?

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!)

  • 写回答

2条回答 默认 最新

  • doushi6864 2012-07-24 21:23
    关注

    you really don't need frames, maybe rather try something like this for this kind of page layout:

    http://jsfiddle.net/YAxQM/

    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;
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效