解决方法
当您使用边框模型时,填充将包含在框大小中.详见
here.
<!DOCTYPE html> <html> <head> <title>padding example</title> <style type="text/css"> .seventy { display: block; float: left; width: 70%; background-color: red; } .thirty { display: block; float: left; width: 30%; padding: 25px; Box-sizing: border-Box; -webkit-Box-sizing: border-Box; -moz-Box-sizing: border-Box; background-color: green; } </style> </head> <body> <div class="seventy">Stuff</div> <div class="thirty">More Stuff</div> </body> </html>