making a block filling the full width of its container

guineo

New Member
How can I make a block filling the full width of its container given the fact both are absolutely positionned, and the inside one has padding.I've made a JSFiddle:http://jsfiddle.net/dmdBB/here a sample:\[code\]<style>.containerOut { position: absolute; width: 400px; height: 400px; border: thin solid black;}.containerIn { position: absolute; outline: 1px solid red; width: auto; padding: 4px;}</style><div class="containerOut"> <div class="containerIn"> im not large enough </div></div>\[/code\]In this sample, the .containerIn element is too thin. If I set its width to 100%, it would overflow because of its padding.PS: I would like a CSS solution, I know that placing an intermediate HTML container with 100%width and 0margin/padding/border would solve the problem.
 
Top