在设计静态页面时,有一部分布局需要使用绝对定位,那么它的父元素就要使用相对定位,这样一来就使承载绝对定位元素的容器脱离了文档流,现在让容器水平居中难倒了我这小菜鸡。它就一直这个样子:
这是源码:
<!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
*,*:before,*:aft