zoukankan      html  css  js  c++  java
  • html伪选择子的顺序问题

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html> 

    <head> 
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /> 

    <title> </title> 
    <style>
    a:link
    {text-decoration:none;}
    a:visited
    {text-decoration:none;}
    /*link和visited一定要放在active和hover的前面,因为这四个属性特殊性相同且link和visited包含active和hover状态,如果放在后面会覆盖active和hover的共有CSS属性(比如此例中,如果将link和visited放在active和hover的后面,link和visited的text-decoration属性设置会覆盖active和hover的text-decoration属性设置,使链接下划线始终不出现)*/

    a:hover
    {text-decoration:underline;color:black;}
    a:active
    {text-decoration:underline;color:red;}
    /*此外active一定要放在hover后面,因为hover属性也包含active属性且他们特殊性相同,如果hover出现在active后面,hover将覆盖active的共有CSS属性(比如本例中如果a:hover在a:active后面,a:hover的color属性设置将覆盖a:active的color属性设置,将导致鼠标点击链接时还是显示黑色字体而不是红色)*/
    /*
    因此官方推荐的设置顺序是:link visited hover active
    */
    </style>
    </head> 

    <body> 
    <href="#">Click</a>
    </body> 
    </html> 
  • 相关阅读:
    linux下面安装maven
    go 安装
    linux scp 服务器远程拷贝
    git有merge时如何删除分支
    influxdb ERR: error parsing query: found -, expected
    influxDB学习总结
    influxdb Measurements
    go exec: "gcc": executable file not found in %PATH%
    php计算脚本执行时间
    安装nodejs和grunt以后出现 /usr/bin/env: node: No such file or directory
  • 原文地址:https://www.cnblogs.com/OpenCoder/p/1564209.html
Copyright © 2011-2022 走看看