Cara Memasang Kotak Pencarian Search Box di Blog
Romeltea | Follow @romel_tea
Kotak Pencarian (Search Box) adalah widget untuk mencari postingan dalam sebuah blog. Biasanya kotak pencarian ditampilkan di sidebar atau di navigasi menu. Ada juga yang di bagian header blog.
Berikut ini salah satu desain kotak pencarian dan cara memasangnya di sidebar blog.
Cara Memasang Kotak Pencarian Search Box di Blog
1. Klik Tema > Add a Gadget2. Pilih HTML/JavaScript
3. Judul widget kosongkan.
4. Copas atau simpan kode berikut ini di kolom yang tersedia
<style>
#cse-search-box {display:block;overflow:hidden;position:relative;margin:10px 0;font-weight:normal;border:1px solid #ddd;padding:0;transition:all .4s}
#search-text{background:#fff;font-size:12px;color:#222;border:0;outline:0;overflow:hidden;padding:10px 15px}
#search-box input[type="text"]{padding:7px 12px 6px 7px;color:#000;outline:none;letter-spacing:1px}
#search-button{background:#eee;position:absolute;border:0;border-left:1px solid #ddd;top:0;right:0;padding:8px 15px;cursor:pointer;text-align:center;transition:all .4s}
#search-button:before{font-family:fontawesome;content:"\f002";color:#999;text-align:center;right:0;top:0;left:0;bottom:0;font-size:120%;transition:all.4s}
#search-button:hover{background:#fff;color:#666;}
#search-button:hover:before{color:#666;}
#search-box::-webkit-input-placeholder,#search-box:-moz-placeholder,#search-box::-moz-placeholder {color:#222;}
</style>
<div id='search-box'>
<form action='/search' id='cse-search-box' method='get'>
<input id='search-text' name='q' onblur='if (this.placeholder == "") {this.placeholder = "Search here...";}'onfocus='if (this.value == "Search here...") {this.value = ""}' placeholder='Search...' type='text'/>
<button id='search-button' type='submit'/>
</form>
</div>
<div class='clear'/>
5. Save. Simpan!
Demonya seperti ini:
Demikian Cara Memasang Kotak Pencarian Search Box di Blog. Jika tidak berkenan dengan desain di atas, masih banyak desain kotak pencarian lainnya, sebagaimana dibagikan Helplogger berikut ini.
<style> #searchbox { width: 280px; background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkNUvftIucQzTRF5cvWVEVx3gm0I4J3e550HJElpGhYMYcQj2l3yMiLHIaEJ_43MMAW9xnEsWcrX_7S1FBM08MjUSk9kOWCIHHWUdMZ0npkthSKu-kAgF24-Y-tZvJETiMPPVFeUYhfCux/s1600/search-box.png) no-repeat; } #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: transparent; border: 0px; font-family: "Avant Garde", Avantgarde, "Century Gothic", CenturyGothic, "AppleGothic", sans-serif; font-size: 14px; color: #f2f2f2 !important; padding: 10px 35px 10px 20px; width: 220px; } #searchbox input[type="text"]:focus { color: #fff; } #button-submit{ background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaFLXuV60kLbJJFrwB7paN6co8MDrUoVBRoiq2NcNKr8yTYjzCFEues8I9SVtrrmdSS6QcIOarhpef43wn-JMpjjKwo3aBPSpcxV54orMx34PD2PYs2wq32Z5M02sXjys1f-O4OnJP84Wz/s1600/search-icon.png) no-repeat; margin-left: -40px; border-width: 0px; width: 40px; height: 50px; } #button-submit:hover { background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYty9TGhgLT71OkAM48rCnNW7ZtZpDs3aQyz-ZvClPi9tWW0gNpjqtVCEYP_RHeRMp8tmyO6ZVYh9Jfe30Ss-gbpCzk_yOk8AYnau4zicykX3naCDCNllD1Sy-wC7Xli6X85hV63PVA_31/s1600/search-icon-hover.png); } </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 { 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/AVvXsEhR9BXdH9jwNQBV2eqcz9FnHvPFQPNPZ5wxbTPof29e8N0j3cgO90N08E8FDqf83a_VmBtt6spOOmfo7qUM0N-UEIYW9ZG7grL_SsHT7wxyre9KjRVxFNu2Sy5LKJEvsmNpvVTdeRBeVpko/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/AVvXsEhUfKKRIl0MU5goUitBV2bdsT04d_p7bBTzJ6ynWzdkP05LwVqP6z3k0l_1woqq4bjQKnbw9C_21FLAG7fTVxQDweRYC5drQLPf-FUzJbHJf6Zor4DOH66YyJNtHJ1z1V-3IenWzsRQ0S-j/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: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2S-p5ZVenZfHPs5yHe9vU7SoEZ6wm9FdJUiuiIPduS6STWW6hpSo0wJIyjUxy6d93Q-CQh9MxhCXl00y5lSMPwEfra7wpZy5DPhzM3i7gnoDUMutrDKEYvnccsqyFsAQP-b5kt1m44HNw/s1600/search-box1.png) no-repeat; width: 250px; height: 65px; } 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; padding: 5px 0px 5px 20px; margin: 10px 15px 0px 0px; border-width: 0px; font-family: "Brush Script MT", cursive; font-size: 12px; color: #595959; width: 65%; font-weight: bold; display: inline-table; vertical-align: top; } #button-submit { background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNDcqcia5a5mk6mm_Ib533mW7f-SXlfYn6cDUkKDriFp83venDhrbtIzX4dkIGo1rqVa-vOzlSW7JrEI6MWuB2QPRbo6UbVmwG89MWaYsyWTIjQsXkgW12aJfK2RSuSVlvSzjF6gmJBcff/s1600/magnifier.png) no-repeat; border-width: 0px; cursor: pointer; margin-top: 10px; width: 19px; height: 25px; } #button-submit:hover { background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBbV-aTqwF4QoDgxKv8aNfrkUCEjTHNCEg9RknRODA3lupNteR1OdV9ZRw3Hn6z45a-7pvjn1vZsq6shuTzeuXYejhVgQnfYQ5EoRMee3B5z51mVmjiVVOelQKyddmoou_xIkp5IiY6mKF/s1600/magnifier-hover.png) no-repeat; } #button-submit:active { background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBbV-aTqwF4QoDgxKv8aNfrkUCEjTHNCEg9RknRODA3lupNteR1OdV9ZRw3Hn6z45a-7pvjn1vZsq6shuTzeuXYejhVgQnfYQ5EoRMee3B5z51mVmjiVVOelQKyddmoou_xIkp5IiY6mKF/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 class="textarea" name="q" type="text" size="15" placeholder="Search 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/AVvXsEhR9BXdH9jwNQBV2eqcz9FnHvPFQPNPZ5wxbTPof29e8N0j3cgO90N08E8FDqf83a_VmBtt6spOOmfo7qUM0N-UEIYW9ZG7grL_SsHT7wxyre9KjRVxFNu2Sy5LKJEvsmNpvVTdeRBeVpko/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/AVvXsEi9jbvD1KeMR8DISh6KU_rgOBc4HlgQh-zV-NuOhEPougYst6DX8YvsDaSBGz00wttkKXzJA8Xj3gZvS-fgITum474ACdVZH5Zv-nnUafAuMs8mJOmegtjCwKH1RMlGvbju3XTucQlmYKRW/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/AVvXsEjul2lWljdRh1qGuCuSQAjil3hFF4XSVLatLyDVpFCGWlptsfhfWx7VFvr54hS_DsPv2KCNi3VXE18hqX4lAkDwEyZWb1iwDS2FT4sOmKZdYi3au__P0m0SpB5tcno8uzVuN8G7yl9DrfHe/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/AVvXsEi80oD2aQqb01ovtSMzHTPm1dA_wv3RmRECocnPqz92rlq8aDYqwG0aUYehDMlzw0tThWWJIreibv_ZeSLSqBfyGtfSn_ZxJoYaUFSH8stVO5LQwFSmB7FNilUAEAvLGJBwKmMVSHhUMSNv/s1600/magnifier-hover.png) no-repeat; } #button-submit:active { background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi80oD2aQqb01ovtSMzHTPm1dA_wv3RmRECocnPqz92rlq8aDYqwG0aUYehDMlzw0tThWWJIreibv_ZeSLSqBfyGtfSn_ZxJoYaUFSH8stVO5LQwFSmB7FNilUAEAvLGJBwKmMVSHhUMSNv/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> #searchbox { background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy1MsdTlwjxIm7VUKOAg2oyzJrJ_BPxfxPPe8Kh6It10J19oYzm-iTAcoz_sw946VkW9Ipw1K96Bp-2Z8WXV7AT4bOPZMUwLetWxl8s4yVhNce4XHY78jklAnnfqMSs10N1tn4yYPFrQ12/s1600/search-box.png) no-repeat; height: 27px; width: 202px; } 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: 0px 0px 0px 12px; padding: 5px 0px 5px 0px; border-width: 0px; font-family: "Arial Narrow", Arial, sans-serif; font-size: 12px; font-style: italic; width: 77%; color: #828282; display: inline-table; vertical-align: top; } #button-submit { background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVeac9dYEuJcjnNZx-hVEvbpQ9hschpTs1ob9tOzp9DCAFcNKvoG_kuXvXGAvD_kHH_XIiTq9DBJi6HJ3gALz6vSwuflTpN08QGm6XSgeuE4b8_5y_5K01hqLRscWildxNI1poqVJdfP1h/s1600/search-button.png) no-repeat; border-width: 0px; cursor: pointer; width: 30px; height: 25px; } #button-submit:hover { background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVeZz89KDy0UW5dypag8YXFO0hV3xEWHeSMcFvx17GkbYCi2VAEl9pbh_zu1qffJDZ_9vleDS5DzwaVswzuz81_zGc4lUsjq6POm_esXxran392C2ZxTGuXQfVoMjjrX8npaybLtJQin88/s1600/search-button-hover.png) no-repeat; } #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 here...' type='text'/> <button id='search-button' type='submit'><span>Search</span></button> </form> </div>
Jika ingin warna lain, ganti warna merah dengan warha background lainnya seperti dalam gambar.
Demikian Cara Memasang Kotak Pencarian Search Box di Blog.*
Previous
« Prev Post
« Prev Post
Next
Next Post »
Next Post »
No comments on Cara Memasang Kotak Pencarian Search Box di Blog
Post a Comment
No Spam, Please!