【发布时间】:2020-07-13 19:18:08
【问题描述】:
它是我正在尝试构建的登录和登录表单,当我将鼠标悬停在按钮上时,它会立即进行注册。我希望将鼠标悬停在注册按钮上后,下划线会立即移动。请告诉我为什么下划线不滑动。
#form{
width: 300px;
margin: auto;
display: flex;
flex-direction: column;
justify-content: center;
}
.butts{
display: flex;
justify-content: center;
}
#form .butt{
width: 150px;
height: 50px;
font-size: 25px;
display: inline-block;
}
hr{
height: .25rem;
width: 150px;
margin: 0;
background: tomato;
border: none;
transition: 1s ease-in-out;
}
#butt2:hover ~ hr{
margin-left: 10px;
}
<section id="form">
<div class="butts">
<button class="butt" id="butt1">Login</button>
<button class="butt" id="butt2">Sign Up</button>
</div>
<hr/>
</section>
【问题讨论】:
标签: html css flexbox underline