CSS
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
.wrapper {
display: block;
width: 100%; /* define your max site width here */
margin: 0 auto; /* centers the container, keep if not 100% wide */
padding: 0;
clear: both;
}
.container {
display: inline-block;
}
.bar-left,
.bar-right,
.bar-mid {
float: left;
display: inline-block;
height: 100% !important;
}
.bar-left, .bar-right {
width: 20%; /* sidebar width */
overflow: hidden; /* hide extra content */
}
.bar-mid {
width: 60%; /* main content width */
overflow: scroll; /* add scrollbar for extra content */
}
HTML
<div class="wrapper">
<div class="container">
<div class="bar-left">
// stuff
</div>
<div class="bar-mid">
// stuff
</div>
<div class="bar-right">
// stuff
</div>
</div>
</div>
那么你应该做的是使用根据需要media query
调整元素的宽度。有一个插件可以让浏览器在没有本地支持here的情况下使用媒体查询。
使用css声明min-width
很好,但IE浏览器不能很好地播放。
来源
2011-09-19 17:03:38
Ben
你在哪里应用最小宽度?我只是尝试过,它工作正常。尝试将最小宽度添加到**外部**编号。 –
你正在推动你能用HTML/CSS在这里完成什么的边缘......你希望你的网页有什么样的支持?据我所知,除非高度不允许,否则左边的页眉和页脚必须始终可见。 – sg3s