Material Design Lite - 导航标题中的搜索栏

时间:2016-06-19 00:11:34

标签: css material-design-lite

好的问题是,当我加载它时 - https://codepen.io/russellharrower/pen/aZmJya您会注意到右侧与左侧不同。我想知道如何纠正这个问题。

我需要正确的填充,就像左边一样。

        <div class="mdl-layout__header-row">
            <!-- Title -->
            <span class="mdl-layout-title">IPET</span></span>
            <!-- Add spacer, to align navigation to the right -->
            <div class="mdl-layout-spacer"></div>
            <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>

        <button id="demo-menu-lower-right"
                class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--icon">
          <i class="material-icons">chat</i>
        </button>
        <ul class="mdl-menu mdl-js-menu mdl-js-ripple-effect mdl-menu--bottom-right"
            for="demo-menu-lower-right">
          <li class="mdl-menu__item">Some Action</li>
          <li class="mdl-menu__item">Another Action</li>
          <li disabled class="mdl-menu__item">Disabled Action</li>
          <li class="mdl-menu__item">Yet Another Action</li>
        </ul>
            </div>

        </div>

    </header>

1 个答案:

答案 0 :(得分:0)

好吧,看起来应该像更新.mdl-layout__header-row元素上的样式一样简单。像这样:

.mdl-layout__header-row {
  padding: 0 80px 0 80px;
}

根据需要调整填充。编辑,因为我误读并使左边相同而不是其他方式。这是一个更新的Codepen:

https://codepen.io/thecox/pen/ezdveV