我想在我的ASP.NET MVC4
佈局模板的標題部分構建一個包含3列(固定 - 液體 - 液體)的標題,我無法完全理解IE6 +的工作原理,鉻,FF等IE6/7列布局CSS問題
具體來說,我需要它看起來像
|--------------------------------------|
| wrapper |
| |---------| |----------| |---------| |
| | left | | title | | right | |
| |---------| |----------| |---------| |
|--------------------------------------|
漁獲(除了有支持IE6和IE7)是,我需要一些包裝當窗口得到小於發生500像素;看起來像。這種包裝只需要支持媒體查詢的瀏覽器才能發生。 (因此對於IE < 9,在調整縮小尺寸時可以壓縮上面示例中的「標題」)。
|--------------------------------------|
| header-wrapper |
| |---------| |---------| |
| | left | | right | |
| |---------| |---------| |
| |
| |----------------------------------| |
| | title | |
| |----------------------------------| |
|--------------------------------------|
這裏是CSS我已經走到這一步,
.content-wrapper {
margin: 0 auto;
max-width: 1140px;
}
.header-wrapper {
text-align: center;
vertical-align: text-bottom;
}
.header-left-box {
float: left;
width: 160px;
}
.header-right-box {
float: right;
margin:auto;
}
.header-center-box {
min-width: 200px;
background:none;
margin:auto;
width:50%;
padding: 4px;
}
.site-logo
{
background-image:url('/Content/images/logo.png');
background-repeat: no-repeat;
background-position: top left;
display:block;
width:130px;
height:80px;
margin-bottom: 5px;
}
這裏是MVC4模板的相關部分
<header>
<div class="content-wrapper header-wrapper">
<div class="header-left-box">
<div class="site-logo"></div>
</div>
<div class="header-right-box">
<nav>
<ul id="menu"><li>Quit</li></ul>
</nav>
</div>
<div class="header-center-box">
<p>title</p>
</div>
</div>
</header>
我寧願一個利用CSS的解決方案和HTML。
直到V9,IE不支持媒體查詢。我懷疑只有CSS的方法會起作用。 – 2013-03-26 20:52:39
感謝Diodeus,我編輯了這個問題以考慮到這一點。 – Jason 2013-03-27 12:41:46