code show as below:
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <title>Document</title> <style> #father{ width:500px; height:500px; background:pink; margin:10px; } #son{ width:200px; height:200px; background:gray; margin:10px; } </style> </head> <body> <div id="father"> <div id="son"></div> </div> </body> </html>
The effect of starting the browser is as follows, and it is found that the margins set by the parent and child divs overlap.
Reason: All sibling or nested box elements have overlapping margins
Solution: