一、写在前面
绝对定位中使用百分比,和非绝对定位使用百分比,之间存在区别,一个是针对padding box
,另一个是针对content box
。
二、详细解释
<!DOCTYPE html>
<html lang="cn">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
#parent {
position: relative;
widt