我想创建一个列表组,其中包括Bootstrap中的DropDown菜单。
重要提示:我想点击列表组行-不仅文本应该是可点击的!
如果按照我的方式进行操作,则带有DorpDownMenu的列表组项的顶部会变圆。 我在做什么错了?
感谢您的帮助!
<!doctype html>
<html lang="de">
<head>
<title>Title</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-4">
<a href="#" class="list-group-item list-group-item-action">Without Dropdown</a>
<div>
<a href="#" class="list-group-item list-group-item-action dropdown-toggle" data-toggle="dropdown">DropdownMenu1</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Item1</a></li>
<li><a class="dropdown-item" href="#">Item2</a></li>
<li><a class="dropdown-item" href="#">Item3</a></li>
</ul>
</div>
<div>
<a href="#" class="list-group-item list-group-item-action dropdown-toggle" data-toggle="dropdown">DropdownMenu2</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Item4</a></li>
<li><a class="dropdown-item" href="#">Item5</a></li>
<li><a class="dropdown-item" href="#">Item6</a></li>
</ul>
</div>
<a href="#" class="list-group-item list-group-item-action">Without Dropdown</a>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin="anonymous"></script>
</body>
</html>