1.先写一个base.html主体页面,将公共部分放在base.html页面中调用
2.在各个页面中调用公共的base.html页面
{extend name=“相对路径+base.html”}
//base.html页面 {include file='public/template/index/iecheck.html'" /} //兼容IE的html语言 <body> {include file="public/template/index/header.html" /} //公共头部 <!--页面CSS开始{--> {block name="css"} {/block} <!--页面CSS结束}--> <!--页面内容开始{--> {block name="centent"} {/block} <!--页面内容结束}--> <!--页面JS{--> {block name="script"} {/block} <!--页面JS结束}-- <!--页面尾部开始{--> {include file="public/template/index/footer.html" /} //页脚 <!--页面尾部结束}--> </body> </html>
3.兼容IE的html语言
<!DOCTYPE html> <!--[if lt IE 6 ]> <html class="ie6"> <![endif]--> <!--[if IE 7 ]> <html class="ie7"> <![endif]--> <!--[if IE 8 ]> <html class="ie8"> <![endif]--> <!--[if IE 9 ]> <html class="ie9"> <![endif]--> <html> <head></head>