Go here and paste HTML code into the HTML pane and CSS code into the CSS pane to test and inspect the result.
HTML:
<div id="outer"> <p>Some text</p> <div id="inner1"> <p>Some text</p> </div> <div id="inner2"> <p>Some text</p> </div> <div id="inner3"> <p>Some text</p> <div id="inner3_inner"> <p>Some text</p> </div> </div> </div>
We can inspect the layout using borders.
CSS:
#outer {border: 5px solid red;}
#inner1 {border: 5px solid darkgreen;}
#inner2 {border: 5px solid blue;}
#inner3 {border: 5px solid orange;}
#inner3_inner {border: 5px solid purple;}
Continue reading “Padding and margin in nested divs (containers)”

