是否可以在同一行中有两个固定div,一个在左边,一个在右边,在容器内,与该容器的边距对齐?
任何解决方案必须是ie8兼容,并且中心div必须以50%的宽度响应。
.container {
max-width: 500px;
width: 100%;
display: table;
background-color: yellow;
}
.left {
display: inline-table;
width: 50px;
position: fixed;
background-color: red;
}
.right {
display: inline-table;
width: 150px;
position: fixed;
background-color: blue;
}
.center {
display: inline-table;
height: 50px;
margin: 0 auto;
width: 50%;
text-align: center;
}
<div class="container">
<div class="left">Left</div>
<div class="center">center</div>
<div class="right">Right</div>
</div>
答案 0 :(得分:1)
只需使用
200000
答案 1 :(得分:0)
试一试
.container {
max-width: 500px;
width:100%;
display: table;
background-color: yellow;
}
.left {
display: inline-table;
width: 50px;
background-color: red;
}
.right {
display: inline-table;
width: 150px;
background-color: blue;
float: right;
}
.center {
display: inline-table;
width: 50px;
text-align: center;
margin-left: 35%;
}