A simple search input with an icon at the right
A Pen by Ismail Ghallou (Smakosh) on CodePen.
A simple search input with an icon at the right
A Pen by Ismail Ghallou (Smakosh) on CodePen.
| .container | |
| .field-input | |
| input(type='text', placeholder='Search...') | |
| span | |
| body { | |
| margin: 0; | |
| padding: 0; | |
| } | |
| .container { | |
| max-width: 960px; | |
| margin: 0 auto; | |
| width: 100%; | |
| padding: 5rem 2rem; | |
| .field-input { | |
| text-align: center; | |
| input { | |
| text-align: left; | |
| border-radius: 6rem; | |
| border: 1px solid rgb(160, 160, 160); | |
| padding: .6rem 2rem .6rem 1rem; | |
| width: 12rem; | |
| font-family: 'roboto'; | |
| transition: .5s; | |
| &:focus { | |
| outline: none; | |
| border-color: #212121; | |
| transition: .5s; | |
| } | |
| } | |
| span:before { | |
| content: ''; | |
| cursor: pointer; | |
| position: relative; | |
| font-family: 'fontawesome'; | |
| top: 0; | |
| right: 1.5rem; | |
| } | |
| } | |
| } | |
| <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" /> | |
| <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet" /> |