The percentage values of the inner and outer margins are calculated relative to the width of the parent element.
Code:
<!DOCTYPE html>
<html>
<head>
<style>
.a {
width: 200px;
height: 200px;
border: 1px solid black;
}
.b {
width: 50px;
height: 50px;
padding: 10%;
margin: 10%;
background-color: red;
}
</style>
</head>
<body>
<div class="a">
<div class="b"></div>
</div>
</body>
</html>
Show results: