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