【发布时间】:2021-11-18 21:21:36
【问题描述】:
我想在悬停另一个按钮元素时显示一个按钮元素,但我的代码不起作用。
HTML 代码
<div class="right-account">
<button class="btn_login">MY ACCOUNT</button>
<a href="../products/user_cart.php"><button class="btn_signup">MY CART</button></a><br>
<button class="pwd_button">Change Password</button>
</div>
CSS 代码
.pwd_button{
display: none;
border: 1px solid #13619f;
background: #2371b7;
padding: 5px;
color: white;
font-size: 15px;
}
.btn_login:hover + .pwd_button{
display: block;
}
但是这段代码不起作用。
【问题讨论】: