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

来源:互联网 发布:淘宝旺旺账号在哪里看 编辑:程序博客网 时间:2024/06/07 12:57
<!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>

0 0
原创粉丝点击