【发布时间】:2017-01-31 14:14:12
【问题描述】:
我不完全确定如何提出这个问题,但基本上,我有一个带有按钮的 div,在 CSS 中有一些 :hover 状态,但是,我希望在单击按钮时,它会保持悬停状态,这可能吗?
我的代码
#englishbutton {
width:200px;
height:50px;
font-family: 'Raleway', sans-serif;
margin:0px 20px 20px 20px;
border:none;
outline:none;
background-color:#F16D71;
color:#FFFFFF;
transition: .3s background-color;
text-align:center;
font-size:20px;
border-radius:15px;
}
#englishbutton:hover {
background-color:#F5999C;
color:#FFFFFF;
cursor:pointer;
}
<div id="actionsection">
<input name="englishbutton" type="button" id="englishbutton" value="ENGLISH">
</div>
我曾尝试搜索类似的问题,其中一个说要使用 :focus state 但它不起作用,任何帮助都会非常感激!
【问题讨论】:
标签: javascript jquery html css hover