Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a fixed footer in angularjs material design

This is my page layout.

<div  layout="column" layout-fill ng-controller="MainCtrl as mc">
      <header>

        <md-toolbar md-scroll-shrink>
           <div layout="row" layout-align="center center" flex>
            HEADER INFO
          </div>
        </md-toolbar>

      </header>

      <main>
        <div ui-view>
        </div>
      </main>

      <footer>
        <md-toolbar class="md-scroll-shrink">
          <div layout="row" layout-align="center center" flex>
            FOOTER INFO
          </div>
        </md-toolbar>
      </footer>

  </div>

Currently footer is displaying just after main contents. depending upon the size of main either footer displaying somewhere middle of screen or goes below page height.

I want footer to be fixed always bottom of screen. and depending on the size of main, there should be a scroll in main content.

can anyone help me on this?

like image 652
Devesh Agrawal Avatar asked Mar 05 '16 13:03

Devesh Agrawal


1 Answers

You just need to add <main flex> and css overflow-y: auto;. See this plunker: http://plnkr.co/edit/GQjcrqhwB2T5ohZwC5EL?p=preview

like image 176
Captain Avatar answered Sep 24 '22 00:09

Captain