為什么我這父元素和子元素單獨在兩行
<!DOCTYPE HTML>
<html>
<head>
? ? <meta charset="utf-8">
? ? <title>aa</title>
? ? <style>
? ? ? ? *{padding: 0;
? ? ? ? margin: 0;}
? ? ? ? .per{
? ? ? ? ? ? width: 300px;
? ? ? ? ? ? height: 300px;
? ? ? ? ? ? background: red;
? ? ? ? }
? ? ? ? .son{
? ? ? ? ? ? width: 100px;
? ? ? ? ? ? height: 100px;
? ? ? ? ? ? background: blue;?
? ? ? ? ? ? position: inherit;
? ? ? ? ? ? left: 100px;
? ? ? ? ? ? top: 100px;
? ? ? ? }
? ??
? ? </style>
? ? </head>
? ? <body>
? ? <div class="per"></div>
? ? ? ? <div class="son"></div>
? ? </body>
</html>
2018-07-23
因為你外層得DIV并沒有包裹內層得DIV,DIV是塊級元素,自然會顯示出兩行
2019-11-05
??<div?class="per">
????????????<div?class="son"></div>
????</div>
這么寫