CSS Layout How to - Keep web content below the users view








Question

We would like to know how to keep web content below the users view.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.main-content, .bottom-content {<!--from   w  ww.j  a v  a 2 s . c o m-->
  position: absolute;
  width: 100%;
  height: 100%;
}

.main-content {
  background: red;
}

.bottom-content {
  margin-top: 100%;
  background: blue;
}
</style>
</head>
<body>
  <div class="main-content">
    <a href="#bottom_content">Read theText...</a>
  </div>
  <div class="bottom-content" id="bottom_content">
    blah...blah...blah...blah...blah...
    blah...blah...blah...blah...blah...</div>
</body>
</html>

The code above is rendered as follows: