Setting CSS padding in negative

tis01

New Member
Consider the following HTML. I have a \[code\].wrap\[/code\] div which has left and right padding of 50px. Inside that div I have another div \[code\].full\[/code\]. I want to increase its default width by overcoming the padding of the \[code\].wrap\[/code\]. I am setting its padding to -50px so that its width becomes equal to the width of the .wrap, but it does not work.HTML:\[code\]<div class="wrap"> <div class="inner"> <div class="normal">xx</div> <div class="full">should be same width (300px) as wrap</div> </div></div>\[/code\]CSS:\[code\].wrap{ height: 500px; width: 300px; margin: 0 auto; padding: 0 50px; background: yellow;}.full{ background: orange; padding: 0 -50px;}\[/code\]Demo:http://jsfiddle.net/WDS6X/
 
Back
Top