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

报告相同问题?

悬赏问题

  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题