你正在做的问题是它采取包括填充在内的整个宽度并将其与填充的左侧宽度对齐.您可以通过使用具有相对位置的包装来解决此问题.另外不要忘记使#panel位置相对.
你最终得到的代码是这样的:
a
而CSS:
#panel {
width: 21.25%;
height: 100%;
background-color: #0794ea;
float: left;
padding: 0 1.5%;
box-sizing: border-box;
}
.update {
width: 100%;
background-color: #006699;
text-align: center;
height: 56px;
color: white;
}
.wrapper {
position: relative;
height: 100%;
}
#bottom {
position: absolute;
bottom: 20px;
left: 0;
width: 100%;
background: yellow;
}