详解:19 ::selection

2020-10-28 12:13:41 浏览数 (2)

代码语言:javascript复制
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css">
        ::selection
        {
            color: red;
        }
      
    </style>
</head>
<body>
    <h1>唉</h1>
    <input type="text" name="username" id="" placeholder="合法用户名" />
    <br>
    <input type="text" name="username1" id="" placeholder="输入用户名">
    <br>
    <textarea name="" id="" cols="30" rows="10" placeholder="个人简介"></textarea>
</body>
</html>

核心: ::selection:意思是按住鼠标左键,往右滑动就能显示出效果了

0 人点赞