We would like to know how to enlarge parent div by resizing the children div.
<!-- w w w. j a va 2 s. c om-->
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#a {
overflow: auto;
border: red 1px solid;
position: relative;
}
#b {
height: 400px;
background: yellow;
width: 200px;
float: left;
}
#c {
background: green;
height: 100%;
position: absolute;
right: 0;
width: 40px;
}
</style>
</head>
<body>
<div id="a">
<div id="b">A</div>
<div id="c">B</div>
</div>
</body>
</html>
The code above is rendered as follows: