点晴MIS问题教程区 加入收藏
问题搜索
 您的位置:点晴OA办公管理信息系统『 经验分享&问题答疑 』浏览当前教程  
  

  网站搜索
  搜索范围: 搜索方式: 关键词(可用空格分开)  

  作者及文章信息: 本文热度:595 % 
admin

积分:88521
等级:网站管理员
文数:15851
注册:2004-7-20

 信息   主页       

楼 顶 

 点击input时,不显示边框!


① input{ outline: none; }

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

input{ outline: none; }

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


②:focus 伪类选择器

  像这种问题一般都用在 :focus 伪类选择器 ,用于选取获得焦点的表单元素,焦点也即是光标。

  一般情况下 input 类表单元素才能获取:focus伪类选择器。废话不多少上代码 ,在input:focus 中,点击去除input 显示的边框,如下:(图片可以忽略)

<!DOCTYPE html>

<html>

<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>

  离 线  2023/6/6 0:24:48 
  本文章共有 0 页, 0 张回文,每页有 10 张回文 >> [ ]
页码:  
Copyright 2010-2023 ClickSun All Rights Reserved