Cara membuat widget search box keren

Widget search box ini bisa secara edit langsung ke template dengan cara edit html atau bisa juga dengan cara praktis yaitu tinggal menambah gadget pada layout/tataletak.

Misal jika anda ingin langsung menerapkan nya ke template anda maka taruh bagian css nya di atas </style> dan hilangkan <style> </style> yang sudah saya tuliskan. Dan letakan html nya di atas </body<

Jika ingin cara yang praktis bisa langsung copy pastekan ke dalam html javascript dengan menambahkan widget di tata letak/layout.

4 macam widget search box keren


Untuk hasil nya sudah saya screnshot di masing-masing kode di bawah ini :


<style> #searchbox { width: 240px; } #searchbox input { outline: none; } input:focus::-webkit-input-placeholder { color: transparent; } input:focus:-moz-placeholder { color: transparent; } input:focus::-moz-placeholder { color: transparent; } #searchbox input[type="text"] { background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFzVsZrvEcwYfVojq8NggLZ_TZPTxEFgE-sFc5HQ1DZ8xMUF6V36-sljA_eeoW_Hs92DbK7Td0lIOhr8vd8ca0xTy2Zm4-IuntrX4P7UHFJf8zhihLofOFlmWj9Ttq2Y8ajGeQmgKHdOIT/s1600/search-dark.png) no-repeat 10px 13px #f2f2f2; border: 2px solid #f2f2f2; font: bold 12px Arial,Helvetica,Sans-serif; color: #6A6F75; width: 160px; padding: 14px 17px 12px 30px; -webkit-border-radius: 5px 0px 0px 5px; -moz-border-radius: 5px 0px 0px 5px; border-radius: 5px 0px 0px 5px; text-shadow: 0 2px 3px #fff; -webkit-transition: all 0.7s ease 0s; -moz-transition: all 0.7s ease 0s; -o-transition: all 0.7s ease 0s; transition: all 0.7s ease 0s; } #searchbox input[type="text"]:focus { background: #f7f7f7; border: 2px solid #f7f7f7; width: 200px; padding-left: 10px; } #button-submit{ background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjRv1HrkFfdlmJNxDWo9OFMkKCA0LtcVi1MzxYBYBEUkb0msmvxys7kGD4tO5vy5PdyfmGIU6VOQMYA6PN6YuacaMdQ1f0PEMmOmpGSTeuvw_c0Bi1L5LIVcwrOoaswH79fIovbVg8kAlo/s1600/slider-arrow-right.png) no-repeat; margin-left: -40px; border-width: 0px; width: 43px; height: 45px; } </style> <form id="searchbox" method="get" action="/search" autocomplete="off"> <input name="q" type="text" size="15" placeholder="Enter keywords here..." /> <input id="button-submit" type="submit" value=" "/> </form>


<style> #searchbox { background: #d8d8d8; border: 4px solid #e8e8e8; padding: 20px 10px; width: 250px; } input:focus::-webkit-input-placeholder { color: transparent; } input:focus:-moz-placeholder { color: transparent; } input:focus::-moz-placeholder { color: transparent; } #searchbox input { outline: none; } #searchbox input[type="text"] { background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFzVsZrvEcwYfVojq8NggLZ_TZPTxEFgE-sFc5HQ1DZ8xMUF6V36-sljA_eeoW_Hs92DbK7Td0lIOhr8vd8ca0xTy2Zm4-IuntrX4P7UHFJf8zhihLofOFlmWj9Ttq2Y8ajGeQmgKHdOIT/s1600/search-dark.png) no-repeat 10px 6px #fff; border-width: 1px; border-style: solid; border-color: #fff; font: bold 12px Arial,Helvetica,Sans-serif; color: #bebebe; width: 55%; padding: 8px 15px 8px 30px; } #button-submit { background: #6A6F75; border-width: 0px; padding: 9px 0px; width: 23%; cursor: pointer; font: bold 12px Arial, Helvetica; color: #fff; text-shadow: 0 1px 0 #555; } #button-submit:hover { background: #4f5356; } #button-submit:active { background: #5b5d60; outline: none; } #button-submit::-moz-focus-inner { border: 0; } </style> <form id="searchbox" method="get" action="/search"> <input name="q" type="text" size="15" placeholder="Type here..." /> <input id="button-submit" type="submit" value="Search" /> </form>


<style> #searchbox { background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgByEkA7wIcvAvgSXV2YQZ_pxwl4RsaSxw8JYP5NoE6AMt7sBljMUJUtvVpXBn5gW5KwUPoWNZ9nRPMD9TYFXHRYnicl8-4Dq4nQQz-bc9oQF3lhYvB4sG2F_gIivObMvRkbGKPAFihsgJj/s1600/searchbar.png) no-repeat; width: 208px; height: 29px; } input:focus::-webkit-input-placeholder { color: transparent; } input:focus:-moz-placeholder { color: transparent; } input:focus::-moz-placeholder { color: transparent; } #searchbox input { outline: none; } #searchbox input[type="text"] { background: transparent; margin: 3px 0px 0px 20px; padding: 5px 0px 5px 0px; border-width: 0px; font-family: "Arial Narrow", Arial, sans-serif; font-size: 12px; color: #828282; width: 70%; display: inline-table; vertical-align: top; } #button-submit { background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNfJBnVg0D4Izje59mRYgb_k8YwlUFzAnFG2NiBpxVApmuymJg8TGz5Yp15PdRn2Z7vvOPQdXYf8kcBVrsClGnYDSWJYrzb7g81g7cYRvPDIwEBNqayvsqPY5kgIvhdFUfV90ENAazM6x6/s1600/magnifier.png) no-repeat; border-width: 0px; cursor: pointer; margin-left: 10px; margin-top: 4px; width: 21px; height: 22px; } #button-submit:hover { background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTuliUV8avZUBhMaFAkWjwbHMuRN-EgSofXdG2EQS1aswiJTJ5Dnv2n8dihzWukMlQwHt2XCFYOtaO3MhO-JtTiw-NrddWNDmIKJv6CRON-Nc4cMJJ7UAFCGfCCfjx1o9PIGRGqeRTahJi/s1600/magnifier-hover.png) no-repeat; } #button-submit:active { background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTuliUV8avZUBhMaFAkWjwbHMuRN-EgSofXdG2EQS1aswiJTJ5Dnv2n8dihzWukMlQwHt2XCFYOtaO3MhO-JtTiw-NrddWNDmIKJv6CRON-Nc4cMJJ7UAFCGfCCfjx1o9PIGRGqeRTahJi/s1600/magnifier-hover.png) no-repeat; outline: none; } #button-submit::-moz-focus-inner { border: 0; } </style> <form id="searchbox" method="get" action="/search" autocomplete="off"> <input name="q" type="text" size="15" placeholder="search..." /> <input id="button-submit" type="submit" value="" /> </form>


<style> #search-box { position: relative; width: 100%; margin: 0; } #search-form { height: 40px; border: 1px solid #999; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; background-color: #fff; overflow: hidden; } #search-text { font-size: 14px; color: #ddd; border-width: 0; background: transparent; } #search-box input[type="text"] { width: 90%; padding: 11px 0 12px 1em; color: #333; outline: none; } #search-button { position: absolute; top: 0; right: 0; height: 42px; width: 80px; font-size: 14px; color: #fff; text-align: center; line-height: 42px; border-width: 0; background-color: #4d90fe; -webkit-border-radius: 0px 5px 5px 0px; -moz-border-radius: 0px 5px 5px 0px; border-radius: 0px 5px 5px 0px; cursor: pointer; } </style> <div id='search-box'> <form action='/search' id='search-form' method='get' target='_top'> <input id='search-text' name='q' placeholder='Search Keyword Here....' type='text'/> <button id='search-button' type='submit'><span>Search</span></button> </form> </div>

Silahkan pilih sesuai selera anda dan untuk warna bisa anda ganti di sini :
kode warna html
Selamat mencoba...

Lebih baru Lebih lama