固定宽度100%的位置没有包裹在体内?

时间:2015-07-13 05:06:13

标签: html css

* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}
html, body {
    margin: 0;
    padding: 0;
}


#footer {
    width: 100%;
    border: 1px solid #000000;
    position:fixed;
    padding:0 5px;
    margin:10px;
}

http://jsfiddle.net/x8b4t1ce/

当我使用保证金10时它向右流动?为什么呢?

1 个答案:

答案 0 :(得分:0)

现在移除 array添加width:100%;

中的left:0;right:0;

就像这样

#footer

<强> Demo