JSFiddle - React, Tailwind, and code Playground
by Kocsten
HTML
<h1>Форма поиска для сайта</h1>
<h3>Первая</h3>
<form>
<input type="search" placeholder="Search">
</form>
<h3>Вторая</h3>
<form id="saltoderamig-2">
<input type="search" placeholder="Search">
</form>
CSS
body {
background: #f3efef;
color: #757171;
font: 90%/180% Arial, Helvetica, sans-serif;
width: 800px;
max-width: 96%;
margin: 0 auto;
}
a {
color: #5688b9;
text-decoration: none;
}
a:hover {
color: #e26512;
}
h1 {
font: 1.7em;
line-height: 109%;
color: #181918;
}
p {
margin: 0 0 19px;
}
input {
outline: none;
}
input[type=search] {
-webkit-appearance: textfield;
-webkit-box-sizing: content-box;
font-family: inherit;
font-size: 100%;
}
input::-webkit-search-decoration,
input::-webkit-search-cancel-button {
display: none;
}
input[type=search] {
background: #ededed url(https://static.tumblr.com/ftv85bp/MIXmud4tx/search-icon.png) no-repeat 8px center;
border: solid 1px #ccc;
padding: 8px 9px 10px 29px;
width: 55px;
-webkit-border-radius: 10em;
-moz-border-radius: 10em;
border-radius: 10em;
-webkit-transition: all .5s;
-moz-transition: all .5s;
transition: all .5s;
}
input[type=search]:focus {
width: 130px;
background-color: #f8fdf8;
border-color: #76e086;
-webkit-box-shadow: 0 0 5px rgba(109,207,246,.5);
-moz-box-shadow: 0 0 5px rgba(109,207,246,.5);
box-shadow: 0 0 5px rgba(109,207,246,.5);
}
input:-moz-placeholder {
color: #8e8d8d;
}
input::-webkit-input-placeholder {
color: #8e8d8d;
}
/* Demo 2 */
#saltoderamig-2 input[type=search] {
width: 14px;
padding-left: 9px;
color: transparent;
cursor: pointer;
}
#saltoderamig-2 input[type=search]:hover {
background-color: #fff;
}
#saltoderamig-2 input[type=search]:focus {
width: 129px;
padding-left: 31px;
color: #121213;
background-color: #ebebec;
cursor: auto;
}
#saltoderamig-2 input:-moz-placeholder {
color: transparent;
}
#saltoderamig-2 input::-webkit-input-placeholder {
color: transparent;
}