<!DOCTYPE html> <body onload="document.getElementById('a').style.height='100%';"> <div style="overflow:auto; width:200px; height:200px;"> <div id=a style="width:300px; background:green"> </div> </div>