设为首页 加入收藏

TOP

Gin-Go学习笔记七:Gin-Web框架 布局页面(二)
2017-12-23 06:06:44 】 浏览:2201
Tags:Gin-Go 学习 笔记 Gin-Web 框架 布局 页面
ink rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css"/> <link rel="stylesheet" href="/static/bootstrap/css/bootstrap-theme.min.css"/> <script type="text/java script" src="/static/js/jquery-2.1.1.min.js"></script>  <script type="text/java script" src="/static/bootstrap/js/bootstrap.min.js"></script>  <!--CSS样式文件--> {{template "header"}} </head> <body> <!--内容部分--> <div class="container"> {{template "content"}} </div> <!--底部版权部分--> <div class="sidebar"> {{template "sidebar"}} </div> <!--页面JS的引用--> {{template "jsfile"}} </body> </html>

  

7>  head.tpl的代码如下:

{{define "header"}}

<style>
     body{
         widith:100%;
         height:100%;
         border:none;
     }
     h1 {
        color: red;
        text-align:center; 
     }
     .bodydiv{
        widith:100%;
        height:100%;
        text-align:center;  
        font-size:14px;
        color:#0f0;
     }
     .sidebar{
        widith:100%;
        height:100%;
        text-align:center;  
        font-size:14px;
        color:#000; 
     }
</style>
{{end}}

8>content.html的代码如下:

{{ define "content" }}

    <h1>
        内容部分AAAAAAA
    </h1>

{{end}}

  

9>scripts.tpl的代码如下:

{{define "jsfile"}}
   <script type="text/java script">
    //页面的初始化
    $(document).ready(function() {
        console.log('页面的初始化')        
    });
    console.log('这是JS文件')
</script>
{{end}}

  

10>sidebar.tpl的代码如下:

 

{{define "sidebar"}}
    版权的使用期:2017-12-12~2027-12-12
{{end}}

  

11>下一周进行修整,不写博客了!  

 

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Gin-Go学习笔记五:Gin-Web框架 .. 下一篇Gin-Go学习笔记三:Gin-Web框架 J..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目