調查了這一點後,我發現css自定義沒有問題,這是事實,我已經使用class="container"
將我的導航欄包裝在div中,但也在導航欄中使用了相同的類。 ..
<div class="container"> <!-- <<< wrapping container div -->
<nav class="navbar navbar-inverse" role="navigation">
<div class="container"> <!-- <<< root cause of positioning issue -->
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
的修復程序很簡單,我只是改變了DIV導航欄裏面使用class="container-fluid"
代替,這使它能夠正確地安裝到包裝的div寬度...
<div class="container"> <!-- <<< wrapping container div -->
<nav class="navbar navbar-inverse" role="navigation">
<div class="container-fluid"> <!-- <<< here is the fix -->
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
檢查this working fiddle爲t他完整的例子。
你有代碼示例,使用JSFiddle或codepen.io等? – RattyLaa