html - How can I make header scrollable for smaller screens in MDL? -


with mdl 1.0(http://www.getmdl.io/) i'm trying make header scrollable on bigger & smaller screens. scrollable on bigger screens(like on pc), not on smaller screens.

here's html:

<html>  <head>  	<link rel="stylesheet" href="https://storage.googleapis.com/code.getmdl.io/1.0.0/material.teal-light_green.min.css" />  	<script src="https://storage.googleapis.com/code.getmdl.io/1.0.0/material.min.js"></script>  	<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=material+icons">  </head>  <body>  <!-- simple header scrollable tabs. -->  <div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">    <header class="mdl-layout__header mdl-layout__header--scroll">      <div class="mdl-layout__header-row">        <!-- title -->        <span class="mdl-layout-title">title</span>      </div>      <!-- tabs -->      <div class="mdl-layout__tab-bar mdl-js-ripple-effect">        <a href="#scroll-tab-1" class="mdl-layout__tab is-active">tab 1</a>        <a href="#scroll-tab-2" class="mdl-layout__tab">tab 2</a>        <a href="#scroll-tab-3" class="mdl-layout__tab">tab 3</a>        <a href="#scroll-tab-4" class="mdl-layout__tab">tab 4</a>        <a href="#scroll-tab-5" class="mdl-layout__tab">tab 5</a>        <a href="#scroll-tab-6" class="mdl-layout__tab">tab 6</a>      </div>    </header>    <div class="mdl-layout__drawer">      <span class="mdl-layout-title">title</span>    </div>    <main class="mdl-layout__content">      <section class="mdl-layout__tab-panel is-active" id="scroll-tab-1">        <div class="page-content"><br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!<br />new line!</div>      </section>      <section class="mdl-layout__tab-panel" id="scroll-tab-2">        <div class="page-content"><!-- content goes here --></div>      </section>      <section class="mdl-layout__tab-panel" id="scroll-tab-3">        <div class="page-content"><!-- content goes here --></div>      </section>      <section class="mdl-layout__tab-panel" id="scroll-tab-4">        <div class="page-content"><!-- content goes here --></div>      </section>      <section class="mdl-layout__tab-panel" id="scroll-tab-5">        <div class="page-content"><!-- content goes here --></div>      </section>      <section class="mdl-layout__tab-panel" id="scroll-tab-6">        <div class="page-content"><!-- content goes here --></div>      </section>    </main>  </div>  </body>  </html>

as see, header scrollable bigger screens (like on pc). if make window smaller, or run on smaller screen, header fixed , not scrollable. if remove mdl-layout--fixed-header outer div (main div), header disappears on smaller screens.

any idea how make header scrollable on both bigger , smaller screens?

i had same issue , resolved adding "flex-shrink: 0;" .mdl-layout__content


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -