Cara Membuat Kotak pencarian Search Box


Hai. Gais Kali ini ZTN CODE akan memberikan Tutorial Lagi Cara Membuat Kotak Pencarian Search Box, Oke langsung saja.

Tampilan Search Box seperti ini

1). ketik Tata Letak lalu Tambahkan Gadget/ pilih Javascript dan Pastekan Kode Di bawah ini
HTML and CSS
<style>
    #searchbox {
    width: 280px;
    background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_65qnVVN7cLWs6_ZLZwuQ0UpEgjnQuc7c7wegG1kMfmJvSrVBbQ6ZXrwB1W0dYdtNIgTi4ztUSV-b3TxGglRE-JCn9e3obG8RKVXZq_BUc0MmMWchuZxZ3ih6fCSerpUilgE6Tq6M2f0O/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/AVvXsEhPnDXt6sJryNuIzMLDvrVlvNnFWJmp-RfzirG6DyVHMe8SA5CZ27epMkpRlnaYL0b5i7x7CauVJWfRnxBUo6vwKZWMO9Y0guVhfJMOE4d2VjLW5e8FSoqprIp2WMokZm6MK1R9Ea5JxQ1B/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/AVvXsEj019_6lQI_7rNWgKa5QVYkovxtjkCuUQo-4VMry6UpTCBE8zEL3L36cXgZPz44KNdeXXN8uabP9tlhNu_0HS_0LicLclJQ1ifLV3o_gGdRCZt6opsn_5G6BVEYW4rqsCx_nhZ1W5Piq2cb/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>

2). Gaya Search Box yang ke 2
HTML and CSS
<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/AVvXsEgOciWhw_tAyBSv6XVcxAj12nzGHOTStTJizhR5e_hLx0zEom6-C9Uu-UD_hCP_5dEFnofPdcOTYDjdCYfQ0LAJa6a4NTn__A0zmsHAe5oMFgNEOKtodJw1Ry4CakNj5Mrh4qXnPRUMTyk_/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/AVvXsEiVpMvPhOVUH33PmtXRIIBwI3IkVvK1AKR2jYcTUus52c34-R046-6JF_PvZc7vqyOEEA9Nkqqza_qXfIJK7VxKnpI8-XoIa0Wsd3JWIS9EBN18c4FriDcJHLHiNQytFOYLnJxeO2ZDC6ab/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>

3). Gaya Search Box yang ke 3
HTML and CSS
<style>
    #searchbox {
        background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhveVwVPATP-EyF2bUcyFYMvi289omX0W8DjfObLMuY93MinRDlKFvXiqANUmqRgCPXW3MOQhrUZHoPOOKnj1pO7T3nEVFrLSDVx21g0v3y_wSHVB0lc42VxGFKuSUCt5hi9cVkNaApi23I/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/AVvXsEhnSB_rlzlFZdP1gCvQJusU0N1kKxeISjqrbI8ojbjlwQxDk5LgGS2Yih4Xv7Zu7Y5FUMSWrnKnbUbshxrtk5gQhZBcxOOuJzuinmaqlCy6roD0NhTA9-Oh1j6rqh7CbdQNtL95ZS2RDpg1/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/AVvXsEhlC08MSo5dukz_aagB7OWLKNrwBzdNx0rkknAs0Tw5ldm1bhyphenhyphenTZBkuck8a8Po8m8UbQ8nhCwEYu3BlsXX2sQYi637cF2OsgkjCbtZOpGE44xWIaBU3gncnjqyR2o7pROqURmyfBV20lfqL/s1600/magnifier-hover.png) no-repeat;
    }

    #button-submit:active {
        background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlC08MSo5dukz_aagB7OWLKNrwBzdNx0rkknAs0Tw5ldm1bhyphenhyphenTZBkuck8a8Po8m8UbQ8nhCwEYu3BlsXX2sQYi637cF2OsgkjCbtZOpGE44xWIaBU3gncnjqyR2o7pROqURmyfBV20lfqL/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>

4). Gaya Search Box yang ke 4
HTML and CSS
<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/AVvXsEgOciWhw_tAyBSv6XVcxAj12nzGHOTStTJizhR5e_hLx0zEom6-C9Uu-UD_hCP_5dEFnofPdcOTYDjdCYfQ0LAJa6a4NTn__A0zmsHAe5oMFgNEOKtodJw1Ry4CakNj5Mrh4qXnPRUMTyk_/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>

5). Gaya Search Box yang ke 5
HTML and CSS
<style>
    #searchbox {
        background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixN3Q5xDAjZG8tIGBWCICSi_IAFDp2z3NDV6lf7g596wj4HNV3QzBqt8MzrArqJU3OM7gBL5NDyzBElPwfOjYON8GbgTxHZKO5ElHSjMpBCgbRbZsfE2DngVLqpY0N-ncG9GfkvG0OOzvg/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/AVvXsEhHBGs4vjh2B4URsA4ZIPj4gHwPMm0Vgb5gXqdMVGdXWFluDZhic9iDxtngRCuehR_hUCfgfmRARwOlKuKSZ43YrJoIcePciM2yQTyQ_dQmDJVu1IiJEVZq6bPH6wW_6wmNP61DYrQDtGbi/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/AVvXsEgruQ9HLXz1C41SJ3MxBeXwYZxYUJ46XZ1QO9Q0Z0UbmMcJAtaGUz-vsSH8aSIT_dsy7Uirim_xmUCjcYH_2j5kYdD6OQgYYoxkbFq_FYdefRN2y2htxCvKfVg8QCDUBJJm1jEbw9LC_4nk/s1600/magnifier-hover.png) no-repeat;
    }
    #button-submit:active {
        background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgruQ9HLXz1C41SJ3MxBeXwYZxYUJ46XZ1QO9Q0Z0UbmMcJAtaGUz-vsSH8aSIT_dsy7Uirim_xmUCjcYH_2j5kYdD6OQgYYoxkbFq_FYdefRN2y2htxCvKfVg8QCDUBJJm1jEbw9LC_4nk/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>

6). Gaya Search Box yang ke 6
HTML and CSS
<style>
    #searchbox {
        background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix8L8LTPXRftN0Mwzl4IuHZ1IakSm4ldKnHjEaJ4Pn3TJefok9VdUoRW1AkLvIlKty-0XerRoBW2UsNBHpa-9_rJusVz4eHH3dSh3AuPnjXdXAsHjCtO38GYL_vVEMqfF_EfX2OEb3yIcl/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/AVvXsEjfe_P5VB9TR7f0JQ7odGcJtZd1UwEyt_4_sw1C1cpVw43YSNPB8D6G3GJXFT2gRuJpmiXv1p_imb5QGG7CVz7MKw6JK6xvm7WhEdsvMOK5OQ6tpEUqacVehGeT0K_0m1MZpZRwwLypm3j6/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/AVvXsEiXyQl4a9ldwSzVRp0FJzP0Y5OcoAelsBO5FfzIb_mQn_4TIYmpkIO7aLA_o5cDz6sKvmQOc5v6y821t-EIGqhmySDjHpihudGmtVjvuRH6Vrbhn8uDK3iIJsMWZtz4LUcqqjBHq9QZlwiF/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>

7). Gaya Search Box yang Ke 7
HTML and CSS
<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>

Sekian Dan Selesai, Semoga Dapat membantu kalian,

jika sobat tidak keberatan Silahkan memberikan Respon yang sudah disiapkan dibawah ini

Posting Komentar untuk "Cara Membuat Kotak pencarian Search Box"