HTML CSS examples for CSS Property:padding
Child element's percentage-based size calculated when its parent has padding
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> div.parent {<!--from ww w .j a v a 2s .c o m--> background-color:Chartreuse; padding-left:21px; padding-right:21px; width:201px; height:201px; } div.child { background-color:yellow; width:51%; height:51%; } </style> </head> <body> <div class="parent"> <div class="child"> </div> </div> </body> </html>