I tried setting the margin,padding to move the back-arrow icon to the left of the header but failed. How should I make this correct?
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<!--back arrow-->
<button class="mdl-button mdl-js-button mdl-button--icon" onclick="history.go(-1);">
<i class="material-icons">arrow_back</i>
</button>
<!--Title-->
<span class="mdl-layout-title">Settings</span>
</div>
<!-- Tabs -->
<div class="mdl-layout__tab-bar mdl-js-ripple-effect">
<a href="{{pathFor route='home'}}" class="mdl-layout__tab">Profile</a>
<a href="{{pathFor route='settings'}}" class="mdl-layout__tab">Account</a>
</div>
I had the same problem with the back button. There is no visual demo in the docs, but reading the documentation I found the right way of doing so: just put a class mdl-layout-icon
on your button.
<header class="mdl-layout__header">
<button class="mdl-layout-icon mdl-button mdl-js-button mdl-button--icon" onclick="history.go(-1);">
<i class="material-icons">arrow_back</i>
</button>
<div class="mdl-layout__header-row">
<span class="mdl-layout-title">Some title</span>
<div class="mdl-layout-spacer"></div>
</div>
</header>
Try to use class 'mdl-layout__drawer-button' like this:
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<div class="mdl-layout__drawer-button"><i class="material-icons">arrow_back</i></div>
<div class="mdl-layout__header-row">
<span class="mdl-layout-title">Title</span>
</div>
</header>
<main class="mdl-layout__content">
<div class="page-content">
Content
</div>
</main>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With