css - Can't get a sticky footer working for the life of me -


i've tried every css-only implementation of sticky footers exist on internet seems, , life of me cannot figure out why it's not working me.

the problem code here: https://jsfiddle.net/7ck2xk2p/1/

so problem footer still sitting under content, , not stuck bottom of page.

as might able see, recent attempt technique detailed here ryan fait

* { margin: 0; } html, body {     height: 100%; } .wrapper {     min-height: 100%;     height: auto !important; /* line , next line not necessary unless need ie6 support */     height: 100%;     margin: 0 auto -155px; /* bottom margin negative value of footer's height */ } .footer, .push {     height: 155px; /* .push must same height .footer */ } 

i new, if things messy in fiddle please excuse me. relevant details should still distinguishable though.

what doing wrong?

you can use approach sticky footer (css only)

html,  body {    height: 100%;    margin: 0;  }  div {    min-height: 100%;    /* equal footer height */    margin-bottom: -70px  }  div:after {    content: "";    display: block  }  footer,  div:after {    height: 70px  }  footer {    background: green  }
<div>    lorem ipsum dolor sit amet, consectetur adipiscing elit. morbi dictum vel dolor vel commodo. nam id nisi eros. class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. morbi commodo leo ac enim molestie, vitae sodales    dolor consequat. donec imperdiet orci @ luctus lacinia. donec bibendum velit sed risus eleifend ultricies. sed nisl massa, ornare quis augue et, faucibus feugiat sapien. vestibulum pharetra tempor quam eu congue. proin posuere lorem quis nisl efficitur    aliquam. curabitur elit ex, convallis sed fringilla a, varius quis dui. nullam eget est sed orci imperdiet imperdiet sit amet eget dui. integer egestas nisi sagittis rutrum. quisque id convallis nisl, @ blandit nunc. curabitur elementum viverra tristique.    in auctor pretium mattis. fusce vulputate porta lacus tincidunt rhoncus. aenean dapibus tortor non faucibus laoreet. morbi fringilla leo nisl, imperdiet hendrerit elit semper at. donec suscipit orci in nulla viverra ultrices. donec aliquet risus non    libero viverra, sed aliquam massa congue. aliquam suscipit ullamcorper erat sed vehicula. donec elementum tincidunt dolor, non scelerisque dolor pretium ut. praesent vitae porttitor turpis, et pharetra libero. sed imperdiet tempor facilisis. cras eget    vehicula dolor.  </div>  <footer>    sticky footer.  </footer>


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -