我想把div.father放在屏幕的中心,並把div.son放在div.father的中心。如何把div與CSS的中心?
這是我想要的。
如何重寫我的CSS代碼來獲得結果呢?
<!DOCTYPE html>
<html>
<head>
<meta content="text/html" charset="utf-8">
<title> boxes</title>
<style type="text/css">
div.father{margin: 0 auto;width:300px;height:300px;border:1px solid black;}
div.son{margin: 0 auto;width:100px;height:100px;border:1px solid black;}
</style>
</head>
<body>
<div class="father">
<div class="son"></div>
</div>
</body>
</html>
哪個IE版本需要支持? – fcalderan
關於[centering in css](https://css-tricks.com/centering-css-complete-guide/) – aug