Bucky Ďroid Bucky Ďroid - 1 month ago 13
CSS Question

Header is not visible on smaller screensize

I am using the mateiral css from getmdl.io ..

When i decrease the size of the screen. My header is getting invisible

Codepen.io link :

http://codepen.io/anon/pen/mrZpYb

<html>
<head>
<title>SocialShit</title>

<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.indigo-pink.min.css">
<script defer src="https://code.getmdl.io/1.2.1/material.min.js"></script>


<style>
.mdl-layout__header{
background-color: #ffffff;
color: rgb(0, 0, 0);
}
.mdl-navigation__link{
color: rgb(0, 0, 0)!important;
}
body{
background-color: rgb(217, 217, 217);
}


</style>
</head>
<body>

<div class="mdl-layout mdl-js-layout">
<header class="mdl-layout__header mdl-shadow--4dp ">
<div class="mdl-layout__header-row">
<!-- Title -->
<span class="mdl-layout-title">Logo Here</span>
<!-- Add spacer, to align navigation to the right -->
<div class="mdl-layout-spacer"></div>
<!-- Navigation -->
<nav class="mdl-navigation">
<a class="mdl-navigation__link" href="">Link</a>
<a class="mdl-navigation__link" href="">Link</a>
<a class="mdl-navigation__link" href="">Link</a>
<a class="mdl-navigation__link" href="">Link</a>
</nav>
</div>
</header>
<main class="mdl-layout__content">
<div class="page-content"><!-- Your content goes here --></div>
</main>
</div>


Thank you for your help

Answer

According to the documentation you're missing mdl-layout--fixed-headerin your wrapper to get it shown on smaller screens as well.

  <div class="mdl-layout mdl-js-layout mdl-layout--fixed-header"> ...

Demo

Comments