以下是我的代码。当我将鼠标悬停在搜索按钮上时,我正在改变文字效果。我将按钮背景保持不变,只是在悬停时尝试更改文本的颜色。我不确定我错过了什么。有没有更简单的方法来实现这一目标?该按钮只保留预先悬停的颜色。我没有想法。CSS:不能得到:悬停工作,我错过了什么?
.header_search #search-submit {
width: 80px;
height: 35px;
margin: 0 -83px 0 0;
background: #ff9105;
border: 2px solid black;
border-left: none;
font-size: 14px;
color: #008b95;
-webkit-border-radius: 0 5px 5px 0;
border-radius: 0 5px 5px 0;
}
{{ trans_fast }}
.header_search #search-submit:hover {
background: #ff9105;
color: white
}
你的CSS语法不正确。缺少分号和什么是“{{trans_fast}}”? – Raptor