一、当前页面
{//在当前模板中使用布局模板}
{//layout name="layout" /}
{//如果当前模板不需要调用布局模板,可以直接用下面的标签进行关闭}
{//__NOLAYOUT__}
<style type="text/css">
.main {
width: 800px;
height: 600px;
margin:auto;
background: lightgreen;
text-align: center;
line-height: 600px;
}
</style>
<div class="main">主体内容</div>
2.模板
<style type="text/css">
.header {
width: 800px;
height: 60px;
margin:auto;
background:wheat;
text-align: center;
line-height: 60px;
}
</style>
<div class="header">网站头部</div>
<style type="text/css">
.footer {
width: 800px;
height: 60px;
margin:auto;
background:wheat;
text-align: center;
line-height: 60px;
}
</style>
<div class="footer">网站底部</div>
3.运行结果