Attribute | Value | Description |
---|---|---|
type | button, checkbox, color, date, datetime, datetime-local, email, file, hidden, image, month, number, password, radio, range, reset, search, submit, tel, text, time, url, week | Menentukan jenis elemen <input> untuk menampilkan. |
Gue menemukan
form actionkeren punya by master Hugo Darby-Brown cdpn.io/oBDaj Bentuk kotak pencarian yang menyembunyikan tombol search, tombol akan muncul ketika focus (mengetikan kata dalam kotak pencarian)
DEMO
Keren kan!!!.formCus {
position: relative;
height: 3em;
margin: 0 auto;
width: 25em;
overflow: hidden;
}
.formCus input {
border: none;
height: 100%;
}
.formCus input:focus {
outline: none;
}
.formCus input[type="text"] {
padding: 0 0 0 1em;
width: 100%;
color: #777;
font-size: 19px;
}
.formCus input[type="submit"] {
background: #5096f3;
position: absolute;
right: 0;
top: 0;
width: 5em;
color: #fff;
cursor: pointer;
}
.formCus .input2 :focus {
padding: 0 1em;
}
.formCus .input2 :focus + .input2 {
right: 0;
}
.formCus .input2 [type="submit"] {
right: -5em;
transition: 0.5s;
}
.formCus .input2 [type="submit"]:focus {
right: 0;
}
Markup HTMLposition: relative;
height: 3em;
margin: 0 auto;
width: 25em;
overflow: hidden;
}
.
border: none;
height: 100%;
}
.
outline: none;
}
.
padding: 0 0 0 1em;
width: 100%;
color: #777;
font-size: 19px;
}
.
background: #5096f3;
position: absolute;
right: 0;
top: 0;
width: 5em;
color: #fff;
cursor: pointer;
}
.
padding: 0 1em;
}
.
right: 0;
}
.
right: -5em;
transition: 0.5s;
}
.
right: 0;
}
<form action="" class="formCus " method="get" target="top">
<input class="input2 " type="text" name="q" placeholder="Search something..."/>
<input class="input2 " type="submit" value="Search"/>
</form>
Itu baru area tombol yg menjadi fullstylish, belum lagi area input labels with clean animated b-) Label dengan efek animasi lembut yg lagi ngetrend dimana-mana. Jika kalian tertarik, silahkan pelajari codepen.io/oknoblich/pen/wFGIH The sourceBONUS: cdpn.io/zcwbD - cdpn.io/dLIjt
Happy input \m/
Tidak ada komentar:
Posting Komentar