2017-09-30 11 views
0

ブートストラップ4ベータからのナビゲーションがあります。モバイルビューまたはsmビューで使用すると、メニューボタンをクリックしてもメニューが展開されません。メニューボタンをクリックしても-expands。 ブートストラップ4ベータナビ自動拡張

#nav ul li a { 
 
\t color: white; 
 
} 
 
#nav ul li a:hover { 
 
\t color: orangered; 
 
} 
 
#nav ul li a:active { 
 
\t color: orangered; 
 
\t border-top: 2px solid orangered; 
 
\t text-decoration: none 
 
} 
 
.navbar-brand { 
 
\t text-decoration: none; 
 
\t font-size: 25px; 
 
\t font-weight: bolder; 
 
}
<!doctype html> 
 
<html> 
 
<head> 
 
<meta charset="utf-8"> 
 
<title>Something New</title> 
 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous"> 
 
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"> 
 
</head> 
 
<body> 
 
<nav class="navbar navbar-dark bg-dark navbar-expand-lg" id="nav"> <a class="navbar-brand" href="#"><span style="color: orangered;letter-spacing: 1px">Tech</span> DudeZ</a> 
 
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> 
 
    <div class="collapse navbar-collapse container-fluid" id="navbarSupportedContent"> 
 
    <ul class="navbar-nav ml-auto" style="font-weight: bold"> 
 
     <li class="nav-item active"> <a class="nav-link" href="#">Home</a> </li> 
 
     <li class="nav-item"> <a class="nav-link" href="#">Features</a> </li> 
 
     <li class="nav-item"> <a class="nav-link" href="#">About Us</a> </li> 
 
     <li class="nav-item"> <a class="nav-link" href="#">Our Work</a> </li> 
 
     <li class="nav-item"> <a class="nav-link" href="#">Services</a> </li> 
 
     <li class="nav-item"> <a class="nav-link" href="#">Contact</a> </li> 
 
    </ul> 
 
    </div> 
 
</nav> 
 
</body> 
 
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> 
 
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script> 
 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script> 
 
</html>

答えて

0

あなたはDIVからコンテナ流体を除去することによって、この問題を解決することができます。

<nav class="navbar navbar-dark bg-dark navbar-expand-lg" id="nav"> <a class="navbar-brand" href="#"><span style="color: orangered;letter-spacing: 1px">Tech</span> DudeZ</a> 
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> 
    <div class="collapse navbar-collapse" id="navbarSupportedContent"> 
    <ul class="navbar-nav ml-auto" style="font-weight: bold"> 
     <li class="nav-item active"> <a class="nav-link" href="#">Home</a> </li> 
     <li class="nav-item"> <a class="nav-link" href="#">Features</a> </li> 
     <li class="nav-item"> <a class="nav-link" href="#">About Us</a> </li> 
     <li class="nav-item"> <a class="nav-link" href="#">Our Work</a> </li> 
     <li class="nav-item"> <a class="nav-link" href="#">Services</a> </li> 
     <li class="nav-item"> <a class="nav-link" href="#">Contact</a> </li> 
    </ul> 
    </div> 
</nav> 
関連する問題