当两个元素都处于活动状态时,active和hover的行为如何? 我已经写了一些代码http://jsfiddle.net/z6v4r/来演示这个。显然:悬停是赢家。什么:活动或:悬停工程?
在另一个场景中(关于这一点我是工作)我写的CSS以下HTML:
<div class="abc">
<div class="xyz">
<input type="Something">
</input>
</div>
</div>
CSS
div.abc div.xyz input:hover
{
border: 1px inset rgb(0, 69, 124);
border-radius:15px;
background-color: rgb(0, 69, 124);
color:white;
}
div.abc div.xyz input:active,div.abc div.xyz input:focus
{
border: 1px inset rgb(0, 69, 124);
border-radius:15px;
background-color:rgba(66, 87, 133, 0.24);
outline-style:none;
}
现在的事情是所有这些主动获得:active /:focus的背景颜色和来自:hover的字体os的颜色。
我需要这些概念如何应用于元素。
您已将您的问题复杂化 –
同一问题:http://stackoverflow.com/questions/1677990/what-is-the-difference-between-focus-and-active –
[特定性](https:// developer .mozilla.org/en-US/docs/Web/CSS/Specificity),[继承](https://developer.mozilla.org/en-US/docs/Web/CSS/Inheritance)。 – robertc