為什么我的這個“box1”,“box2”,“box3”不偏移呢?
為什么我的這個“box1”,“box2”,“box3”不偏移呢?
<!DOCTYPE html>
<html>
<head>
? ? <meta charset="UTF-8">
? ? <title>relative</title>
? ? <style type="text/css">
? ? .box {
? ? ? ? width:600px;
? ? ? ? height:120px;
? ? ? ? background: blue;
? ? ? ? display:relative;
? ? }
? ? ?.box1,.box2,.box3{
? ? ? ? ?width:50px;
? ? ? ? ?height:40px;
? ? ? ? ?display:absolute;
? ? ? ? ?left:100px;
? ? ? ? ?top:20px;
? ? ?}
? ? .box1 {
? ? ? ? background: red;
? ? }
? ? .box2 {
? ? ? ? background: orange;
? ? }
? ? .box3 {
? ? ? ? background: green;
? ? }
? ? </style>
</head>
<body>
? ? <div class="box">
? ? ? ? <div class="box1">1</div>
? ? ? ? <div class="box2">2</div>
? ? ? ? <div class="box3">3</div>
? ? </div>
</body>
</html>
2020-11-21
display:relative;?display:absolute;大哥? 哪有這個屬性?position才對