I tried setting width to auto but that didn't work either.
<div style='width:100%;background-color:lightblue;text-align:center'>
test
<div style='margin:0 auto;background-color:blue;'>
new test
</div>
</div>I tried setting width to auto but that didn't work either.
<div style='width:100%;background-color:lightblue;text-align:center'>
test
<div style='margin:0 auto;background-color:blue;'>
new test
</div>
</div> 
    
    use inline or inline-block
<div style='width:100%;background-color:lightblue;text-align:center'>
test<br>
<div style='margin:0 auto;display:inline;background-color:blue;'>
new test
</div>
</div>