【问题标题】:MDL drawer does not fill the height of the page?MDL抽屉没有填满页面的高度?
【发布时间】:2016-11-08 13:14:50
【问题描述】:

我正在使用 Material Design Lite 为我的 Ruby on Rails 应用程序添加一个固定的标题和抽屉。正如您在video 中看到的那样,当我导航到另一个页面时,页面左侧的抽屉菜单不会填满页面的高度。

它一直保持在异常高度(即使我单击另一个链接),直到我刷新页面。谁能弄清楚这里发生了什么?这是我的应用程序视图的主体:

<!-- Material design fixed header and drawer -->
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-drawer
            mdl-layout--fixed-header">
  <header class="mdl-layout__header">
    <div class="mdl-layout__header-row">

      <!-- Add spacer to align search bar to the right -->
      <div class="mdl-layout-spacer"></div>

      <!-- Search bar -->
      <div class="mdl-textfield mdl-js-textfield mdl-textfield--expandable
                  mdl-textfield--floating-label mdl-textfield--align-right">
        <label class="mdl-button mdl-js-button mdl-button--icon"
               for="fixed-header-drawer-exp">
          <i class="material-icons">search</i>
        </label>
        <div class="mdl-textfield__expandable-holder">
          <input class="mdl-textfield__input" type="text" name="sample"
                 id="fixed-header-drawer-exp">
        </div>
      </div>

    </div>
  </header>

  <!-- Drawer menu  -->
  <div class="mdl-layout__drawer">
    <span class="mdl-layout-title"></span>
    <nav class="mdl-navigation">
      <a class="mdl-navigation__link" href="<%= songs_path %>">Home</a>
      <a class="mdl-navigation__link" href="<%= new_song_path %>">Upload</a>
      <a class="mdl-navigation__link" href="">About</a>
    </nav>
  </div>

  <!-- Page content -->
  <main class="mdl-layout__content">
    <div class="page-content"><%= yield %></div>
  </main>
</div>

谢谢大家!

【问题讨论】:

    标签: html css ruby-on-rails material-design


    【解决方案1】:

    我也有同样的问题。 只需添加一个

    <div class="mdl-layout__container"> 
    

    在上面的所有 div 中。 (不要忘记通过在 html 末尾添加“

    ”来关闭 div) 我添加了,它也有效。
    猜你喜欢
    • 1970-01-01
    • 2016-02-18
    • 2015-11-07
    • 1970-01-01
    • 1970-01-01
    • 2020-02-16
    • 2014-04-21
    • 1970-01-01
    • 2020-10-30
    相关资源
    最近更新 更多