fix元素居中

今天的一个面试题,我是这么写的:

复制代码
div{
            position:fixed;
            margin:auto;
            left:0;
            right:0;
            top:0;
            bottom:0;
            width:200px;
            height:150px;
            background: #ccc;
        }
复制代码

效果完全可以,可能今天面试官没有看清我写的吧--

posted @   yaokunlun  阅读(827)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示