html-伪类

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        /*LoVeHAte*/
        a:link{/*link 未被点击的链接*/
            color: blueviolet;
        }
        a:visited{/*已被点击的链接*/
            color: blue;
        }
        a:hover {/*鼠标悬停其上的元素  这个一定要掌握*/
            color: red;
            background: aqua;
            font-size: 20px;
            /*cursor: pointer; 手指*/
            /*cursor: default; 箭头*/
            /*cursor: wait; 等待*/
            /*cursor: help;帮助*/
         }
        a:active{/*鼠标已经再其上按下但是还没有释放的元素*/
            color: yellowgreen;
        }
        div{
            width: 50px;
            height: 50px;
            background: aqua;
        }

        /*改变的是div本身*/
        /*!*div:hover{*! */
            /*width: 100px;*/
            /*height: 100px;*/
            /*background: bisque;*/
        /*}*/
        p{
            width: 20px;
            height: 20px;
            background: red;
            display: none;
        }
        /*改变的是div的后代 p元素*/
        div:hover p{
            width: 30px;
            height: 30px;
            background: blue;
            display: block;
        }
    </style>
</head>
<body>
    <a href="http://www.baidu.com">去百度</a>
    <div>
        <p></p>
    </div>
</body>
</html>

 

转载于:https://www.cnblogs.com/cxhzy/p/10082255.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值