Monday, August 19, 2013

How to set a div to auto adjust it's height with available browser height

HTML

<div id="resize">
  <p>content</p><p>content</p><p>content</p><p>content</p>
</div>
 
CSS:

#resize {
background: #f00;
color: white;
position: absolute;
top: 100px;
left: 200px;
right: 200px;
bottom: 100px;
overflow: auto;
}

p {line-height: 3; margin: 0;}
 

Working Example : Here

No comments:

Post a Comment