CogWramygoore
New Member
When the padding is removed from this div via javascript, Chrome doesn't resize the content to fit:http://jsfiddle.net/XDchs/Likewise, if padding is added, the content is pushed outside of the div:http://jsfiddle.net/XDchs/1/Firefox resizes as I'd expect. Does anyone know why, and how to fix it?HTML:\[code\]<div id="outer"> <div id="inner"> <div id="content">blah</div> </div></div>\[/code\]CSS:\[code\]#outer { background-color:blue; width:300px; margin:0 auto;}#inner { padding-left:100px; margin:2px; background-color:yellow;}#inner.no-padding { padding-left:0;} #content { background-color:red;}\[/code\]JavaScript:\[code\]$(document).ready(function() { $("#inner").addClass("no-padding");});\[/code\]