Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Input text field with only bottom border

How do I style the text input field to make it only have a border-bottom like this one?

Expected Text Input Field

SS

like image 813
amrjo Avatar asked May 26 '16 15:05

amrjo


2 Answers

Use outline:0 for chrome.. and then just set border-bottom as you like

input {    outline: 0;    border-width: 0 0 2px;    border-color: blue  }  input:focus {    border-color: green  }
<input placeholder="Text" type="text" />
like image 135
dippas Avatar answered Sep 22 '22 12:09

dippas


Try this one

.inp {      border:none;      border-bottom: 1px solid #1890ff;      padding: 5px 10px;      outline: none;   }    [placeholder]:focus::-webkit-input-placeholder {      transition: text-indent 0.4s 0.4s ease;       text-indent: -100%;      opacity: 1;   }
<input class="inp" placeholder="What needs to be done?👻"/>
like image 40
nos nart Avatar answered Sep 20 '22 12:09

nos nart