0

I'm creating a webpage that has a central zone of ​​800px. If the resolution is greater "sidebars" will be presented in another color. I have this code:

body {
  width: 800px;
  height: auto;
  ...
}

I wish that when the content was very small the central zone extends until the end of the page. What is the best way to do this?

notGeek
  • 1,394
  • 5
  • 21
  • 40
  • 1
    This is a usual problem. This link may help you: http://stackoverflow.com/questions/485827/css-100-height-with-padding-margin. – Jill-Jênn Vie May 27 '12 at 01:30

1 Answers1

1

The only thing that you could do would be something like this:

<style type="text/css">
  html, body, .container {
    height: 100%;
    width: 800px;
    margin: 0 auto;
  }
  .container {
    background: yellow;
  }
</style>

And...

<body>
  <div class="container">
    dewdewd
  </div>
</body>
Marco Godínez
  • 3,440
  • 2
  • 21
  • 30