阅读背景:

HTML5基础加强css样式篇(右外边距失效问题解释)(四十八)

来源:互联网 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style type="text/css">
        .box-wrapper {
            width: 500px;
            height: 500px;
            background-color: orange;
        }
        .box{
            width: 400px;
            height: 200px;

            margin: 0 auto;
            /*当父元素水平空间不足,设置右外边距失效,优先保证左外边距*/
            margin: 0 200px;
        }
        .box-1{
            background-color: pink;
        }


    </style>
</head>
<body>

<div class="box-wrapper">
    <div class="box box-1"></div>
</div>

<script type="text/javascript">
</script>
</body>
</html><!DOCTYPE html>
<html lang="en">
<head>
    <me



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: