2013-08-21 143 views
0

我正在開發一個web與引導3.0,它具有以下結構:引導與父容器固定寬度

- Sidebar: width 220px, position fixed and top:0 
- Content: margin-left:220px (Because of the sidebar width). 
    - Topbar: position fixed and top 0 

問題是固定的頂欄沒有得到父母的寬度,你可以看到我CSS在此codepen:http://codepen.io/anon/pen/Fzgot

的頂欄上。主要內容頭{} 正如你可以看到我添加寬度:繼承,但它似乎沒有工作

回答

0

這是接近你在之後?
http://www.bootply.com/75880

我加

width:100%; 
max-width:760px; /* set max width as req'd */ 

的。主要內容頭部分

+0

我不能添加最大寬度,因爲它必須適應文檔 – jsertx

+0

@SergiFrom的休息,沒有問題,只需添加寬度:100%;你會很好 –

+0

我之前嘗試過,但看看「紅色搜索面板」發生了什麼?http://codepen.io/sergiolopezevermic/pen/zwHgF – jsertx