I am trying to get my navigation to span across the whole of my column. I am using Bootstrap and Wordpress. At the moment it looks like this, however I want it to stretch across the whole screen.
我試圖讓我的導航跨越整個列。我正在使用Bootstrap和Wordpress。目前它看起來像這樣,但是我想讓它延伸到整個屏幕。
I tried adding the navbar justified class on bootstrap but then stopped it working when it went to responsive design.
我嘗試在bootstrap上添加navbar justified類,但是當它進入響應式設計時停止了它的工作。
Here is my code.
這是我的代碼。
<div class="row">
<div class="col-md-12">
<nav id="menu1" class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<div id="logo" class="pull-left hidden-md hidden-lg">
<div class="logo-small">
<img src="<?php bloginfo('template_directory');?>/images/logo-xs.png" alt="small-logo" class="img-responsive logo-phone"/>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
</div>
</div>
<?php
$args = array(
'theme_location' => 'main-menu',
'depth' => 0,
'container_class' => 'collapse navbar-collapse',
'menu_class' => 'nav navbar-nav',
'walker' => new wp_bootstrap_navwalker()
);
wp_nav_menu($args);
?>
</nav>
<div class="content-top-border hidden-md hidden-lg hidden-sm"></div>
</div>
</div>
0
I added width of 100% to the containing menu and set the width of each individual button to 16.6% this worked.
我在包含菜單中添加了100%的寬度,並將每個按鈕的寬度設置為16.6%。
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2014/10/16/3051e5c0718a922994233d30a5cd47d8.html。