侧面导航折叠按钮

时间:2016-02-28 15:58:37

标签: jquery html css materialize

侧面导航未对齐,我一直在关注框架的文档。见这里的图片。

enter image description here

虽然预期结果如下:

enter image description here

你能帮我解释为什么它不对齐吗?

HTML:

<!DOCTYPE html>
<html>
<head>

     <!--Import Google Icon Font-->
      <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

      <!--Import materialize.css-->
      <link type="text/css" rel="stylesheet" href="<?php echo base_url();?>assets/css/materialize.css"  media="screen,projection"/>

      <!--Let browser know website is optimized for mobile-->
      <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Staff Lounge</title>
</head>

<body>
    <header><!--POI 1-->
        <nav class="top-nav">
            <div class="container">
                <div class="nav-wrapper"><a class="page-title">Administrators Panel</a></div>
            </div>
        </nav>


<div class="container"><!--POI 2-->
    <a href="#" data-activates="nav-mobile" class="button-collapse top-nav full hide-on-large-only">
        <i class="mdi-navigation-menu"></i>
    </a>
</div>

<ul id="nav-mobile" class="side-nav fixed"> <!--POI 3-->
    <li class="bold"><a href="<?php echo base_url();?>admin/dashboardMain" class="waves-effect waves-teal">Main</a></li>
    <li class="bold"><a href="<?php echo base_url();?>admin/dashboardAbout" class="waves-effect waves-teal">About</a></li>
    <li class="no-padding">
        <ul class="collapsible collapsible-accordion">
            <li class="bold"><a class="collapsible-header  waves-effect waves-teal">CSS</a>
                <div class="collapsible-body">
                    <ul>
                        <li><a href="color.html">Color</a></li>
                        <li><a href="grid.html">Grid</a></li>
                        <li><a href="helpers.html">Helpers</a></li>
                        <li><a href="media-css.html">Media</a></li>
                        <li><a href="sass.html">Sass</a></li>
                        <li><a href="shadow.html">Shadow</a></li>
                        <li><a href="table.html">Table</a></li>
                        <li><a href="typography.html">Typography</a></li>
                    </ul>
                </div>
            </li>
        </ul>
    </header>


   <main>
             <div class="container">
                    <div class="row">

            <div class="col s12 m9 l10">

              <div id="structure">
                <h4>Main Dashboard</h4>
                <p class="caption">Please Logout after using the staff accounts</p>
              </div>
          </div>
        </div>
     </main> 

    <footer class="page-footer  grey darken-3">
    <div class="footer-copyright">
        <div class="container">
        </div>

    </div>
</footer>

<!--Import jQuery before materialize.js-->
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>assets/js/materialize.min.js"> </script>


<script type="text/javascript">

    $(document).ready(function(){
// Initialize collapse button
$(".button-collapse").sideNav();
// Initialize collapsible (uncomment the line below if you use the dropdown variation)
$('.collapsible').collapsible();



});


</script>
</body>
</html>

CTRL F. POI 1 - 下面是可折叠的位置 POI 2 - 应该是在浏览器最小化时激活最小化sidenav的那个 POI 3 - 侧导航的内容

你能在这帮忙吗?我已经查看了具体化的代码,我刚刚在我的网站上实现了它,但我不知道为什么它没有对齐。

1 个答案:

答案 0 :(得分:0)

所以事实证明我初始化的css中没有包含一些类,我不知道开发团队为什么要删除它。

这是我初始化以使其发挥作用的那个。

http://materializecss.com/css/ghpages-materialize.css