Dropdown menu getting out of the screen in bootstrap mobile mode

Asked

Viewed 95 times

0

I’m doing a project and my dropdown menu when it’s in mobile mode is out of the screen like this here in the image

inserir a descrição da imagem aqui

<nav class="navbar navbar-expand-md navbar-custom2 ">
<button class="navbar-toggler pt-2" type="button" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><spam class="navbar-toggler-icon"></spam> Menu</button>

	<?php require_once('assets/includes/class-wp-bootstrap-navwalker.php'); ?>
	<?php 
	  	wp_nav_menu( array(
	  	'menu' 			  => 'Menu',
		'theme_location'  => 'menu-header',
		'depth'	          => 2, // 1 = no dropdowns, 2 = with dropdowns.
		'container'       => 'div',
		'container_class' => 'collapse navbar-collapse navbar-collapse-custom',
		'container_id'    => 'bs-example-navbar-collapse-1',
		'menu_class'      => 'navbar-nav mx-auto mb-3 pt-2',
		'fallback_cb'     => 'WP_Bootstrap_Navwalker::fallback',
		'walker'          => new WP_Bootstrap_Navwalker()) 
		);
	?>
</nav>

  • Dude, have you looked at Bootstrap’s Navbar documentation? There are some strange things there, first you are putting the navbar inside a container/Row/col, after the button is outside the UL and not inside.... I recommend viewing this link with the official https://getbootstrap.com/docs/4.0/components/navbar/

  • Yes my friend, I’ve seen it. Button outside ul or inside ul had no interference with my problem, and the reason I put the navbar inside a container/Row is to get it aligned with the content of the site.

  • If you test the code without the first 4 Divs, the error remains the same.

  • If you test the code without ul, the error remains the same

  • Try to edit the question is coca the html code already rendered on the page, not php. Type inspects the menu directly in the browser, takes the Nav html and pastes here in the question, will help to answer you

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.