简单来说%是浏览器百分比单位,em是电脑屏幕的百分比单位
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="">
</head>
<style type="text/css" media="screen">
*{
padding: 0px;
margin: 0px;
}
.bigbox{
width: 100px;
height: 100px;
margin-left: 20%;
background: red;
float:left;
}
.smallbox{
width: 100px;
height: 100px;
margin-left:20em;
background:yellow;
}
body{
background: #2FB0FF;
}
</style>
<body >
<div class="bigbox">
</div>
<div class="smallbox">
</div>
</body>
</html>