点击input时,不显示边框!

① input{ outline: none; }

   鼠标点击input时,出显的黑色边框,怎么去除的问题?

input{ outline: none; }

  可以给边框(border)设置一个颜色,然后把边框轮廓(outline)给去掉,点击的时候就不会出现黑色的边框了,outline设置轮廓的样式,样式是 none时,轮廓不会出现,希望对大家有帮助!

②:focus 伪类选择器

  像这种问题一般都用在 :focus 伪类选择器 ,用于选取获得焦点的表单元素,焦点也即是光标。
  一般情况下 input 类表单元素才能获取:focus伪类选择器。废话不多少上代码 ,在input:focus 中,点击去除input 显示的边框,如下:(图片可以忽略)

.

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>百度输入框</title>
    <style>
        input {
            width: 520px;
            height: 40px;
            border: none;
            box-shadow: 0px 1px 2px #888888 inset;
            background: url(./images/camera_01.png) no-repeat 480px center;
        }

        input:focus {
            width: 520px;
            height: 40px;
            border: none;
            outline: none;
            box-shadow: 0px 0px 3px #005efe inset;
            background: url(./images/camera_02.png) no-repeat 480px center;
        }
    </style>
</head>

<body>

    <input type="text" name="" id="">

</body>

</html>
Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐