Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove border for input elements when clicked/focused

Tags:

css

I have set a border and a border-radius for my input elements. When you focus inside the input tags, an almost blue border without a border radius appears. The same happens when you click on the input[type=submit] element. I ould like to define and control this properties.

I supppose there is a css trick to go about this, but I'm not sure. Do I change the box-shadow properties or the border properties. And how?

input{
   width:60%;
   font-size:1.05em;
   min-width:250px;
   display:block;
   margin-bottom:3.5%;
   padding:0.8% 1.5%;
   border-radius:5px;
   border:1px solid white;
   transform:rotateX(10deg);
 }
.submit{
   background:rgb(0,150,255);
   border:1px solid rgb(0,150,255);
   transition: transform 1s;
   color:white;
   box-shadow: 2px 2px 1px silver;
 }
 input:focus , .submit:focus{
   background:rgba(0,120,255,1);
   border:none;
   transform: scaleY(1.1);
 } 

I'm using a class selector instead of the input[type=submit] selector

like image 631
One Avatar asked Jul 06 '16 22:07

One


People also ask

How do I get rid of the border on my focused input?

Use the :focus pseudo-class with the "no-outline" class to style the form fields that are focused by the user. To have clear fields in your forms, set the outline property to its "none" value, which is used to display no outline.

How do I make my input box border invisible?

border: none transparent; outline: none; This will not only remove the border around the input field but also the orange highlight when the input is in focus. +1 outline:none makes the border disappear even when the input is focused.

How do you remove a border from an element?

We can specify the no border property using CSS border: none, border-width : 0, border : 0 properties.


1 Answers

The css "trick" you're looking for is outline:none

like image 189
Sergio Fandino Avatar answered Sep 28 '22 12:09

Sergio Fandino