gpt4 book ai didi

css - 在 Bootstrap 4 中创建一个仅在单击插入符号时打开的下拉按钮

转载 作者:太空宇宙 更新时间:2023-11-04 01:09:06 25 4
gpt4 key购买 nike

我想创建一个下拉菜单的导航项,但是

  • 当您在文本部分单击它时,它是一个链接,将您带到另一个页面;
  • 当您在插入符上单击它时,它会打开下拉菜单。

有什么好的方法还是必须切换到黑客模式?

最佳答案

试试这个这是完整的文档 https://getbootstrap.com/docs/4.0/components/dropdowns/#split-button-dropdowns

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<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.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<div class="btn-group">
<button type="button" class="btn btn-danger"><a href="google.co.in/?gfe_rd=cr&dcr=0&ei=TGOqWcvWNrKH8Qfr4YKgDw">Link</a></button>
<button type="button" class="btn btn-danger dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Separated link</a>
</div>
</div>

关于css - 在 Bootstrap 4 中创建一个仅在单击插入符号时打开的下拉按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51573365/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com