I
I
ivan_gorodetskii2021-11-08 12:46:21
Bootstrap
ivan_gorodetskii, 2021-11-08 12:46:21

When you click on a hamburger (three bars), the collapsed buttons do not open at a lower resolution, who knows what could be the reason?

<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<title>Портфолио</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">


</head>
<body>	
  <nav class="navbar navbar-expand-md navbar-light bg-dark">
  	<div class="container-fluid">
    	<button class="navbar-toggler navbar-toggler-right btn-link" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon text-white"></span>
      </button>
      	<a class="navbar-brand text-light" href="#">НЛК</a>
      	 <div class="collapse navbar-collapse" id="navbarTogglerDemo02">
      		<ul class="navbar-nav mr-auto mt-2 mt-md-0">
        			<li class="nav-item">
        				<a class="nav-link text-light" href="#">Портфолио</a>
        			</li>
        			<li class="nav-item">
        				  	<a class="nav-link text-light" href="#">Рейтинг</a>
        			</li>
        			<li class="nav-item">
        				<a class="nav-link text-light" href="#">Помощь</a>
        			</li>
        		</ul>
        	</div>
      	</div>
  </nav>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-/bQdsTh/da6pkI1MST/rWKFNjaCP5gBSY4sEBT38Q/9RBh9AH40zEOg7Hlq2THRZ" crossorigin="anonymous"></script>
</body>
</html>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
ivan_gorodetskii, 2021-11-08
@ivan_gorodetskii

I decided.
For some reason, the navbar-expand taken from the cheat sheet did not work for me ( https://bootstrap-4.ru/articles/cheatsheet/ ). A half-Internet break on the same site found a slightly modified code (I give an example below) and it all worked.
Example:
"

<nav class="navbar navbar-expand-lg navbar-light bg-light">
  <div class="container-fluid">
    <button class="navbar-toggler" type="button" data-BS-toggle="collapse" data-BS-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarTogglerDemo01">
      <a class="navbar-brand" href="#">Hidden brand</a>
      <ul class="navbar-nav me-auto mb-2 mb-lg-0">
        <li class="nav-item">
          <a class="nav-link active" aria-current="page" href="#">Home</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#">Link</a>
        </li>
        <li class="nav-item">
          <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
        </li>
      </ul>
      <form class="d-flex">
        <input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
        <button class="btn btn-outline-success" type="submit">Search</button>
      </form>
    </div>
  </div>
</nav>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question