【发布时间】:2023-02-14 22:56:43
【问题描述】:
我有这段代码:
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle buttonForProfile" type="button" id="dropdownMenuButton" data-bs-toggle='dropdown' aria-haspopup="true" aria-expanded="false">
<?php echo $_SESSION['username']; ?>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Profile</a>
<a class="dropdown-item" href="#">Subscriptions</a>
<a class="dropdown-item" href="./php/signout.php">Sign out</a>
</div>
</div>
我添加了一些 css,现在它看起来像这样:
当我点击它时,背景变回默认:
切换下拉菜单时如何更改灰色背景?
【问题讨论】:
标签: html jquery css bootstrap-5