作者linrobz (风御影)
看板Web_Design
标题Re: [问题] 导览列连结视窗的问题
时间Fri Nov 3 00:43:47 2006
※ 引述《qqcsj (开始想念Doener)》之铭言:
: 最近在学css
: 我用css做了一个三栏的版型
: 左边是导览列
: 中间是我网页想呈现的框框
: 请问我要怎麽弄
: 才能让导览列按下去後的内容出现在中间那栏?
我最近写的网页也是像这样子,不过我导览列的连结还是连到另外一个网页去
就是跟原来的页面有一样的导览列的页面
我的作法是用PHP Smarty样板引擎去做
就是引入子样板
a.html
----------------------------------------------------------------------------
<{include file=$top_page}>
<div id="content">
...........
</div>
<{include file=$right_page}>
-----------------------------------------------------------------------------
b.html
---------------------------------------------------------------------------
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div id="header">
<span class="strapline">这是top_page</span>
</div>
</body>
</html>
---------------------------------------------------------------------------
c.html
----------------------------------------------------------------------------
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文件</title>
<link rel="stylesheet" type="text/css" href="CSS/adminData.css" />
</head>
<body>
<div id="nav">
<ul>
<li><a href="....">这是导览列</a></li>
</ul>
</div>
</body>
</html>
-----------------------------------------------------------------------------
a.php
-----------------------------------------------------------------------------
<?php
include ('includes/main_new.php');
require ('includes/loginCheck.php');
$tpl = new Template();
$tpl -> assign("top_page", "b.html");
$tpl -> assign("right_page", "c.html");
$tpl -> display('a.html');
?>
-----------------------------------------------------------------------------
那连到其他网页的时候只要在其他网页的html部份跟a.html一样
<{include file=$top_page}>//重点
<div id="content">
//其他网页的内容打在这里
</div>
<{include file=$right_page}>//重点
理论上用 include 也是可以啦
不过个人偏好用样板引擎
样板引擎的资料是从旗标出版的"PHP Smarty 样板引擎"上面学来的
有需要的话可以去参考一下
网路找应该也可以找到很多
如果有哪里看不懂...我会尽量说明
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 163.13.100.210
1F:推 qqcsj:谢谢~~ 我晚点再来试试 11/03 00:52
2F:→ qqcsj:有问题再来请教^^ 11/03 00:53