zoukankan      html  css  js  c++  java
  • 个人中心标签页导航

    1. 新页面user.html,用<ul ><li role="presentation"> 实现标签页导航。
      <ul class="nav nav-tabs">
        <li role="presentation"><a href="#">Home</a></li>
        <li role="presentation"><a href="#">Profile</a></li>
        <li role="presentation"><a href="#">Messages</a></li>
      </ul>
      <ul class="nav_ul">
          <li role="presentation"><a href="#">questions</a> </li>
          <li role="presentation"><a href="#">comments</a> </li>
          <li role="presentation"><a href="#">information</a> </li>
      </ul>
      

        

    2. user.html继承base.html。
      重写title,head,main块.
      将上述<ul>放在main块中.
      定义新的块user。
      {% extends "myweb.html" %}
      {% block usertitle %}个人中心{% endblock %}
      {% block userhead %}
          <style>
              .nav_ul li{
                  list-style: none;
                  float: left;
                  margin: 10px;
              }
          </style>
      {% endblock %}
      
      {% block mywebbody %}
      <ul class="nav_ul">
          <li role="presentation"><a href="#">questions</a> </li>
          <li role="presentation"><a href="#">comments</a> </li>
          <li role="presentation"><a href="#">information</a> </li>
      </ul>
      
      {% block usercenterbody %}{% endblock %}
      
      {% endblock %}
      
      </html>
      

        



    3. 让上次作业完成的个人中心页面,继承user.html,原个人中心就自动有了标签页导航。
      {% extends "user.html" %}
      
      {% block usercenterbody %}
          <div class="page-header">
              <h3><span class="glyphicon glyphicon-user" aria-hidden="true"></span>{{ username }}<br><small>全部问答<span class="badge>"></span> </small> </h3>
              <ul class="list-group"style="margin:10px">
                  {% for foo in comments %}
                      <li class="list-group-item">
                          <span class="glyphicon glyphicon-heart-empty" aria-hidden="true"></span>
                          <a href="#">{{ foo.author.username }}</a>
                          <span class="badge">{{ foo.creat_time }}</span>
                          <p style="align-content: center">{{ foo.detail }}</p>
                      </li>
                  {% endfor %}
              </ul>
          </div>
      
          <div class="page-header">
              <h3><span class="glyphicon glyphicon-user" aria-hidden="true"></span>{{ user }}<br><small>全部评论<span class="badge>"></span> </small> </h3>
              <ul class="list-group"style="margin:10px">
                  {% for foo in comments %}
                      <li class="list-group-item">
                          <span class="glyphicon glyphicon-heart-empty" aria-hidden="true"></span>
                          <a href="#">{{ foo.author.username }}</a>
                          <span class="badge">{{ foo.creat_time }}</span>
                          <p style="align-content: center">{{ foo.detail }}</p>
                      </li>
                  {% endfor %}
              </ul>
      
          </div>
      
          <div class="page-header">
              <h3><span class="glyphicon glyphicon-user" aria-hidden="true"></span>{{ user }}<br><small>个人信息<span class="badge>"></span> </small> </h3>
              <ul class="list-group"style="margin:10px">
                  <li class="list-group-item">用户:{{ username }}</li>
                  <li class="list-group-item">编号:</li>
                  <li class="list-group-item">昵称:</li>
              </ul>
          </div>
      {% endblock %}
      

        

    4. 制作个人中心的三个子页面,重写user.html中定义的user块。

    5. 思考 如何实现点标签页导航到达不同的个人中心子页面。
  • 相关阅读:
    Gulp使用入门操作---压缩JS
    Linux如何查看进程及如何杀死进程
    连不上GitHub,也ping不通,亲测解决方案
    idea一键生成mybatis工具
    idea逆向生成hibernate工程
    idea常用快捷键大全
    mysql日期函数
    数据库事务
    idea激活码
    oracle创建表前校验是否存在
  • 原文地址:https://www.cnblogs.com/Sun584125503/p/8033260.html
Copyright © 2011-2022 走看看