css CSS Pseudo-Classes演示:a,悬停,焦点,活动

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css CSS Pseudo-Classes演示:a,悬停,焦点,活动相关的知识,希望对你有一定的参考价值。

/**
 * CSS Pseudo-Classes Demo
 **/

/* Normal Element Rule */
a {
  font-size: 64px;
}

/* Hover Pseudo Class:
    Changes the style only when mouse hovers
    over the preceding element.
*/
a:hover {
  background-color: red;
}

/* Focus Pseudo Class
    Changes the style only when browser
    gives the element focus
    (in this case, after the link is clicked).
*/
a:focus {
  background-color: orange;
}

/* Active Pseudo Class
    Changes the style only while the user
    clicks down on an element. This style ceases
    when the user releases their click.
*/
a:active {
  background-color: black;
}

以上是关于css CSS Pseudo-Classes演示:a,悬停,焦点,活动的主要内容,如果未能解决你的问题,请参考以下文章

css总结12:CSS 伪类(Pseudo-classes)

css基础 CSS 组合选择符CSS 伪类CSS 伪元素

CSS优先级详解(权重详解)

css伪类和伪元素属性

伪类与伪元素

css中a.other:hover,这个是啥意思?