Articles → BOOTSTRAP → Create A Dropdown Menu Using The Btn-Group Class In Bootstrap
Create A Dropdown Menu Using The Btn-Group Class In Bootstrap
Code
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="btn-group">
<button type="button" class="btn btn-primary">Menu1</button>
<button type="button" class="btn btn-primary">Menu2</button>
<div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
Menu3<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Submenu1</a></li>
<li><a href="#">Submenu2</a></li>
</ul>
</div>
</div>
</body>
</html>
Output
Click to Enlarge