スマートフォンのモック
長方形
角丸
長方形

HTML・CSSで作るおしゃれな検索フォームのデザイン10選

  • HTML
  • CSS
  • カラー調整対応
  • レスポンシブ対応

サイト内検索において必要不可欠な検索ボックスのデザインスニペットをまとめました。どれもコピペ可能ですので、ご自身のサイトに適したデザインのフォームをお好きな色にカスタマイズして、ぜひ取り入れてみてください。

フラットな検索フォーム

フラットな検索フォームの長方形ver

長方形

  1. デザイン調整
  2. HTMLをコピペ
  3. CSSをコピペ
  4. 完了
step1
デザインを調整する
step2
HTMLをコピペする
HTML
<form action="#" class="search-form-005">
    <label>
        <input type="text" placeholder="キーワードを入力">
    </label>
    <button type="submit" aria-label="検索"></button>
</form>
step3
CSSをコピペする
CSS
.search-form-005 {
    display: flex;
    align-items: center;
    overflow: hidden;
    border-radius: 3px;
}

.search-form-005 input {
    width: 250px;
    height: 40px;
    padding: 5px 15px;
    border: none;
    box-sizing: border-box;
    background-color: #e6edf3;
    outline: none;
}

.search-form-005 input::placeholder {
    color: #767d83;
}

.search-form-005 button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 40px;
    border: none;
    background-color: #2589d0;
    cursor: pointer;
}

.search-form-005 button::after {
    width: 15px;
    height: 15px;
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%20%3Cpath%20d%3D%22M23.7%2020.8%2019%2016.1c-.2-.2-.5-.3-.8-.3h-.8c1.3-1.7%202-3.7%202-6C19.5%204.4%2015.1%200%209.7%200S0%204.4%200%209.7s4.4%209.7%209.7%209.7c2.3%200%204.3-.8%206-2v.8c0%20.3.1.6.3.8l4.7%204.7c.4.4%201.2.4%201.6%200l1.3-1.3c.5-.5.5-1.2.1-1.6zm-14-5.1c-3.3%200-6-2.7-6-6s2.7-6%206-6%206%202.7%206%206-2.6%206-6%206z%22%20fill%3D%22%23fff%22%3E%3C%2Fpath%3E%20%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    content: '';
}
フラットな検索フォームの角丸ver

角丸

step1
デザインを調整する
step2
HTMLをコピペする
HTML
<form action="#" class="search-form-006">
    <label>
        <input type="text" placeholder="キーワードを入力">
    </label>
    <button type="submit" aria-label="検索"></button>
</form>
step3
CSSをコピペする
CSS
.search-form-006 {
    display: flex;
    align-items: center;
    overflow: hidden;
    border-radius: 20px;
}

.search-form-006 input {
    width: 250px;
    height: 40px;
    padding: 5px 15px;
    border: none;
    box-sizing: border-box;
    background-color: #e6edf3;
    outline: none;
}

.search-form-006 input::placeholder {
    color: #767d83;
}

.search-form-006 button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 40px;
    border: none;
    background-color: #2589d0;
    cursor: pointer;
}

.search-form-006 button::after {
    width: 15px;
    height: 15px;
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%20%3Cpath%20d%3D%22M23.7%2020.8%2019%2016.1c-.2-.2-.5-.3-.8-.3h-.8c1.3-1.7%202-3.7%202-6C19.5%204.4%2015.1%200%209.7%200S0%204.4%200%209.7s4.4%209.7%209.7%209.7c2.3%200%204.3-.8%206-2v.8c0%20.3.1.6.3.8l4.7%204.7c.4.4%201.2.4%201.6%200l1.3-1.3c.5-.5.5-1.2.1-1.6zm-14-5.1c-3.3%200-6-2.7-6-6s2.7-6%206-6%206%202.7%206%206-2.6%206-6%206z%22%20fill%3D%22%23fff%22%3E%3C%2Fpath%3E%20%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    content: '';
}

単色の検索フォーム

単色の検索フォームの長方形ver

長方形

step1
デザインを調整する
step2
HTMLをコピペする
HTML
<form action="#" class="search-form-001">
    <label>
        <input type="text" placeholder="キーワードを入力">
    </label>
    <button type="submit" aria-label="検索"></button>
</form>
step3
CSSをコピペする
CSS
.search-form-001 {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 2px solid #2589d0;
    border-radius: 3px;
}

.search-form-001 input {
    width: 250px;
    height: 40px;
    padding: 5px 15px;
    border: none;
    box-sizing: border-box;
    outline: none;
}

.search-form-001 input::placeholder{
    color: #767d83;
}

.search-form-001 button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 40px;
    border: none;
    background-color: #2589d0;
    cursor: pointer;
}

.search-form-001 button::after {
    width: 17px;
    height: 17px;
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%20%3Cpath%20d%3D%22M23.7%2020.8%2019%2016.1c-.2-.2-.5-.3-.8-.3h-.8c1.3-1.7%202-3.7%202-6C19.5%204.4%2015.1%200%209.7%200S0%204.4%200%209.7s4.4%209.7%209.7%209.7c2.3%200%204.3-.8%206-2v.8c0%20.3.1.6.3.8l4.7%204.7c.4.4%201.2.4%201.6%200l1.3-1.3c.5-.5.5-1.2.1-1.6zm-14-5.1c-3.3%200-6-2.7-6-6s2.7-6%206-6%206%202.7%206%206-2.6%206-6%206z%22%20fill%3D%22%23fff%22%3E%3C%2Fpath%3E%20%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    content: '';
}
単色の検索フォームの角丸ver

角丸

step1
デザインを調整する
step2
HTMLをコピペする
HTML
<form action="#" class="search-form-002">
    <label>
        <input type="text" placeholder="キーワードを入力">
    </label>
    <button type="submit" aria-label="検索"></button>
</form>
step3
CSSをコピペする
CSS
.search-form-002 {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 2px solid #2589d0;
    border-radius: 20px;
}

.search-form-002 input {
    width: 250px;
    height: 40px;
    padding: 5px 15px;
    border: none;
    box-sizing: border-box;
    outline: none;
}

.search-form-002 input::placeholder{
    color: #767d83;
}

.search-form-002 button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 40px;
    border: none;
    background-color: #2589d0;
    cursor: pointer;
}

.search-form-002 button::after {
    width: 15px;
    height: 15px;
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%20%3Cpath%20d%3D%22M23.7%2020.8%2019%2016.1c-.2-.2-.5-.3-.8-.3h-.8c1.3-1.7%202-3.7%202-6C19.5%204.4%2015.1%200%209.7%200S0%204.4%200%209.7s4.4%209.7%209.7%209.7c2.3%200%204.3-.8%206-2v.8c0%20.3.1.6.3.8l4.7%204.7c.4.4%201.2.4%201.6%200l1.3-1.3c.5-.5.5-1.2.1-1.6zm-14-5.1c-3.3%200-6-2.7-6-6s2.7-6%206-6%206%202.7%206%206-2.6%206-6%206z%22%20fill%3D%22%23fff%22%3E%3C%2Fpath%3E%20%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    content: '';
}

立体的な検索フォーム

立体的な検索フォームの長方形ver

長方形

step1
デザインを調整する
step2
HTMLをコピペする
HTML
<form action="#" class="search-form-007">
    <label>
        <input type="text" placeholder="キーワードを入力">
    </label>
    <button type="submit" aria-label="検索"></button>
</form>
step3
CSSをコピペする
CSS
.search-form-007 {
    display: flex;
    align-items: center;
    overflow: hidden;
    border-radius: 3px;
    box-shadow: 0 4px 4px rgba(0, 0, 0, .02), 0 2px 3px -2px rgba(0, 0, 0, .05);
}

.search-form-007 input {
    width: 250px;
    height: 40px;
    padding: 5px 15px;
    border: none;
    box-sizing: border-box;
    background-color: #fff;
    outline: none;
}

.search-form-007 input::placeholder {
    color: #767d83;
}

.search-form-007 button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 40px;
    border: none;
    background-color: #2589d0;
    cursor: pointer;
}

.search-form-007 button::after {
    width: 15px;
    height: 15px;
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%20%3Cpath%20d%3D%22M23.7%2020.8%2019%2016.1c-.2-.2-.5-.3-.8-.3h-.8c1.3-1.7%202-3.7%202-6C19.5%204.4%2015.1%200%209.7%200S0%204.4%200%209.7s4.4%209.7%209.7%209.7c2.3%200%204.3-.8%206-2v.8c0%20.3.1.6.3.8l4.7%204.7c.4.4%201.2.4%201.6%200l1.3-1.3c.5-.5.5-1.2.1-1.6zm-14-5.1c-3.3%200-6-2.7-6-6s2.7-6%206-6%206%202.7%206%206-2.6%206-6%206z%22%20fill%3D%22%23fff%22%3E%3C%2Fpath%3E%20%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    content: '';
}
立体的な検索フォームの角丸ver

角丸

step1
デザインを調整する
step2
HTMLをコピペする
HTML
<form action="#" class="search-form-008">
    <label>
        <input type="text" placeholder="キーワードを入力">
    </label>
    <button type="submit" aria-label="検索"></button>
</form>
step3
CSSをコピペする
CSS
.search-form-008 {
    display: flex;
    align-items: center;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 4px 4px rgba(0, 0, 0, .02), 0 2px 3px -2px rgba(0, 0, 0, .05);
}

.search-form-008 input {
    width: 250px;
    height: 40px;
    padding: 5px 15px;
    border: none;
    box-sizing: border-box;
    background-color: #fff;
    outline: none;
}

.search-form-008 input::placeholder {
    color: #767d83;
}

.search-form-008 button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 40px;
    border: none;
    background-color: #2589d0;
    cursor: pointer;
}

.search-form-008 button::after {
    width: 15px;
    height: 15px;
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%20%3Cpath%20d%3D%22M23.7%2020.8%2019%2016.1c-.2-.2-.5-.3-.8-.3h-.8c1.3-1.7%202-3.7%202-6C19.5%204.4%2015.1%200%209.7%200S0%204.4%200%209.7s4.4%209.7%209.7%209.7c2.3%200%204.3-.8%206-2v.8c0%20.3.1.6.3.8l4.7%204.7c.4.4%201.2.4%201.6%200l1.3-1.3c.5-.5.5-1.2.1-1.6zm-14-5.1c-3.3%200-6-2.7-6-6s2.7-6%206-6%206%202.7%206%206-2.6%206-6%206z%22%20fill%3D%22%23fff%22%3E%3C%2Fpath%3E%20%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    content: '';
}

シンプルな検索フォーム

シンプルな検索フォームの長方形ver

長方形

step1
デザインを調整する
step2
HTMLをコピペする
HTML
<form action="#" class="search-form-003">
    <label>
        <input type="text" placeholder="キーワードを入力">
    </label>
    <button type="submit" aria-label="検索"></button>
</form>
step3
CSSをコピペする
CSS
.search-form-003 {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid #767d83;
    border-radius: 3px;
}

.search-form-003 input {
    width: 250px;
    height: 40px;
    padding: 5px 15px;
    border: none;
    box-sizing: border-box;
    outline: none;
}

.search-form-003 input::placeholder{
    color: #767d83;
}

.search-form-003 button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 40px;
    border: none;
    background-color: transparent;
    cursor: pointer;
}

.search-form-003 button::after {
    width: 18px;
    height: 18px;
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%20%3Cpath%20d%3D%22M23.7%2020.8%2019%2016.1c-.2-.2-.5-.3-.8-.3h-.8c1.3-1.7%202-3.7%202-6C19.5%204.4%2015.1%200%209.7%200S0%204.4%200%209.7s4.4%209.7%209.7%209.7c2.3%200%204.3-.8%206-2v.8c0%20.3.1.6.3.8l4.7%204.7c.4.4%201.2.4%201.6%200l1.3-1.3c.5-.5.5-1.2.1-1.6zm-14-5.1c-3.3%200-6-2.7-6-6s2.7-6%206-6%206%202.7%206%206-2.6%206-6%206z%22%20fill%3D%22%23767d83%22%3E%3C%2Fpath%3E%20%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    content: '';
}
シンプルな検索フォームの角丸ver

角丸

step1
デザインを調整する
step2
HTMLをコピペする
HTML
<form action="#" class="search-form-004">
    <label>
        <input type="text" placeholder="キーワードを入力">
    </label>
    <button type="submit" aria-label="検索"></button>
</form>
step3
CSSをコピペする
CSS
.search-form-004 {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid #767d83;
    border-radius: 20px;
}

.search-form-004 input {
    width: 250px;
    height: 40px;
    padding: 5px 15px;
    border: none;
    box-sizing: border-box;
    outline: none;
}

.search-form-004 input::placeholder{
    color: #767d83;
}

.search-form-004 button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 40px;
    border: none;
    background-color: transparent;
    cursor: pointer;
}

.search-form-004 button::after {
    width: 18px;
    height: 18px;
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%20%3Cpath%20d%3D%22M23.7%2020.8%2019%2016.1c-.2-.2-.5-.3-.8-.3h-.8c1.3-1.7%202-3.7%202-6C19.5%204.4%2015.1%200%209.7%200S0%204.4%200%209.7s4.4%209.7%209.7%209.7c2.3%200%204.3-.8%206-2v.8c0%20.3.1.6.3.8l4.7%204.7c.4.4%201.2.4%201.6%200l1.3-1.3c.5-.5.5-1.2.1-1.6zm-14-5.1c-3.3%200-6-2.7-6-6s2.7-6%206-6%206%202.7%206%206-2.6%206-6%206z%22%20fill%3D%22%23767d83%22%3E%3C%2Fpath%3E%20%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    content: '';
}

その他の検索フォーム

その他の検索フォームのGoogleのトップページ風ver

Googleのトップページ風

step1
デザインを調整する
step2
HTMLをコピペする
HTML
<form action="#" class="search-form-009">
    <label>
        <input type="text" aria-label="キーワードを入力">
    </label>
</form>
step3
CSSをコピペする
CSS
.search-form-009 {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
}

.search-form-009:hover {
    box-shadow: 0 1px 6px rgb(32 33 36 / 28%);
}

.search-form-009::before {
    width: 45px;
    height: 15px;
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%20%3Cpath%20d%3D%22M23.7%2020.8%2019%2016.1c-.2-.2-.5-.3-.8-.3h-.8c1.3-1.7%202-3.7%202-6C19.5%204.4%2015.1%200%209.7%200S0%204.4%200%209.7s4.4%209.7%209.7%209.7c2.3%200%204.3-.8%206-2v.8c0%20.3.1.6.3.8l4.7%204.7c.4.4%201.2.4%201.6%200l1.3-1.3c.5-.5.5-1.2.1-1.6zm-14-5.1c-3.3%200-6-2.7-6-6s2.7-6%206-6%206%202.7%206%206-2.6%206-6%206z%22%20fill%3D%22%239aa0a6%22%3E%3C%2Fpath%3E%20%3C%2Fsvg%3E');
    background-position: center;
    background-repeat: no-repeat;
    content: '';
}

.search-form-009 input {
    width: 250px;
    height: 40px;
    padding: 5px 25px 5px 0;
    border: none;
    box-sizing: border-box;
    outline: none;
}
その他の検索フォームのYahooのトップページ風ver

Yahooのトップページ風

step1
デザインを調整する
step2
HTMLをコピペする
HTML
<form action="#" class="search-form-010">
    <label>
        <input type="text" aria-label="キーワードを入力">
    </label>
    <button type="submit">検索</button>
</form>
step3
CSSをコピペする
CSS
.search-form-010 {
    display: flex;
    align-items: center;
    gap: 0 10px;
}

.search-form-010 label {
    width: 250px;
}

.search-form-010 input {
    width: 100%;
    height: 34px;
    padding: 1px 5px 1px 8px;
    border: 1px solid #999;
    box-sizing: border-box;
    color: #000;
    outline: none;
}

.search-form-010 button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30%;
    max-width: 140px;
    height: 34px;
    border: none;
    background-color: #4070ff;
    color: #fff;
    cursor: pointer;
}

.search-form-010 button::before {
    width: 14px;
    height: 14px;
    margin-right: 5px;
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%20%3Cpath%20d%3D%22M23.7%2020.8%2019%2016.1c-.2-.2-.5-.3-.8-.3h-.8c1.3-1.7%202-3.7%202-6C19.5%204.4%2015.1%200%209.7%200S0%204.4%200%209.7s4.4%209.7%209.7%209.7c2.3%200%204.3-.8%206-2v.8c0%20.3.1.6.3.8l4.7%204.7c.4.4%201.2.4%201.6%200l1.3-1.3c.5-.5.5-1.2.1-1.6zm-14-5.1c-3.3%200-6-2.7-6-6s2.7-6%206-6%206%202.7%206%206-2.6%206-6%206z%22%20fill%3D%22%23fff%22%3E%3C%2Fpath%3E%20%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    content: '';
}