html - Make decoration div with border stretch down to top of sticky footer -


(note: question has not been asked anywhere on internet far can see, , i've been searching 2 days.)

i have content div translucent background , decorative border around sits under site logo, won't stretch down meet top portion of footer stuck bottom of page position absolute. contact page couple sentences of text , simple contact form, therefore not enough content fill whole page.

specifically, need div border around fill whole page, without creating vertical scroll bar, , meet top of absolutely positioned footer.

the rest of site not use absolutely positioned footer there enough content consistently push footer far down. so, css properties acceptable here, table hack if necessary!

js fiddle

header {      height: 44px;      background: orange;  }    article {      box-sizing: border-box;  	border: 1px solid red;   }    footer {      height: 22px;      background: green;      position: absolute;      bottom: 0;  }
<body>  <header>  header  </header>  <article>  article small amount of content<br>  <br>  , simple contact form<br>  <br>  red border needs meet top of footer<br>  without creating vertical scroll bar  </article>  <footer>  footer  </footer>  </body>

you use css3 set height of "article" 100% minus both header , footer height (in case 66px) this:

height:calc(100% - 66px); 

just sure every parent of article element have height set 100% (including html , body).

your modified fiddle


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -