サイト内の情報を探しやすくするために欠かせない、検索ボックス。
検索しやすいことはもちろん、サイトの雰囲気に合ったデザインを選ぶことで、ページ全体にも自然になじみます。
この記事では、HTMLとCSSをコピーして使える、おしゃれな検索ボックスデザインを10種類紹介します。
シンプルな枠線タイプや丸みのあるデザイン、アイコン付き、影を付けたデザインなどをまとめました。
色やサイズを変更しながら、サイトに合った検索ボックスを取り入れてみてください。
検索機能について
このページで紹介するのは、検索ボックスの見た目を整えるHTML・CSSです。WordPressでは、掲載しているコードを貼り付けることでサイト内検索として使用できます。
WordPress以外で使用する場合は、検索機能を別途用意する必要があります。
シンプルで使いやすい検索ボックスデザイン
まずは、さまざまなサイトになじみやすい、シンプルな検索ボックスデザインを紹介します。
枠線や丸み、アイコンの位置などが異なる6種類から、サイトの雰囲気に合うものを選んでみてください。
ベーシックな検索ボックス
入力欄と検索ボタンを横に並べた、シンプルで使いやすい検索ボックスです。
装飾が控えめなため、ブログやコーポレートサイトなど、さまざまなページに取り入れやすいデザインです。
<form class="search-design-01" action="/" method="get">
<input
type="search"
name="s"
placeholder="キーワードを入力"
aria-label="サイト内検索"
>
<button type="submit" aria-label="検索する">
<svg
viewBox="0 0 24 24"
aria-hidden="true"
>
<circle
cx="10.5"
cy="10.5"
r="6.5"
></circle>
<line
x1="15.5"
y1="15.5"
x2="21"
y2="21"
></line>
</svg>
</button>
</form>
.search-design-01 {
display: flex;
width: 100%;
max-width: 460px;
height: 52px;
overflow: hidden;
background: #ffffff;
border: 1px solid #b9c3d1;
border-radius: 6px;
}
.search-design-01 input {
flex: 1;
min-width: 0;
padding: 0 16px;
font: inherit;
background: transparent;
border: 0;
outline: none;
}
.search-design-01 input::placeholder {
color: #888888;
}
.search-design-01 input::-webkit-search-cancel-button {
display: none;
}
.search-design-01 button {
display: grid;
place-items: center;
flex: 0 0 58px;
padding: 0;
background: #c98792;
border: 0;
cursor: pointer;
}
.search-design-01 button svg {
display: block;
width: 25px;
height: 25px;
fill: none;
stroke: #ffffff;
stroke-width: 1.8;
stroke-linecap: round;
}
.search-design-01 button:hover {
opacity: 0.85;
}
丸みのある検索ボックス
丸みのある入力欄に、円形の検索ボタンを組み合わせたデザインです。
やわらかく親しみやすい印象があり、ブログやサービスサイトなど、幅広いページに取り入れやすくなっています。
<form class="search-design-02" action="/" method="get">
<input
type="search"
name="s"
placeholder="キーワードを入力"
aria-label="サイト内検索"
>
<button type="submit" aria-label="検索する">
<svg
viewBox="0 0 24 24"
aria-hidden="true"
>
<circle
cx="10.5"
cy="10.5"
r="6.5"
></circle>
<line
x1="15.5"
y1="15.5"
x2="21"
y2="21"
></line>
</svg>
</button>
</form>
.search-design-02 {
display: flex;
align-items: center;
width: 100%;
max-width: 460px;
height: 52px;
padding-left: 18px;
background: #ffffff;
border: 1px solid #b9c3d1;
border-radius: 999px;
}
.search-design-02 input {
flex: 1;
min-width: 0;
padding: 0;
font: inherit;
background: transparent;
border: 0;
outline: none;
}
.search-design-02 input::-webkit-search-cancel-button {
display: none;
}
.search-design-02 button {
display: grid;
place-items: center;
flex: 0 0 42px;
width: 42px;
height: 42px;
margin-right: 5px;
padding: 0;
background: #c98792;
border: 0;
border-radius: 50%;
cursor: pointer;
}
.search-design-02 button svg {
display: block;
width: 22px;
height: 22px;
fill: none;
stroke: #ffffff;
stroke-width: 1.8;
stroke-linecap: round;
}
.search-design-02 button:hover {
opacity: 0.85;
}
下線だけの検索ボックス
枠線を使わず、入力欄の下に細い線だけを入れた検索ボックスです。
装飾が控えめですっきりしているため、シンプルなサイトや、ページ内で検索ボックスを目立たせすぎたくない場合に使いやすいデザインです。
<form class="search-design-03" action="/" method="get">
<input
type="search"
name="s"
placeholder="キーワードを入力"
aria-label="サイト内検索"
>
<button type="submit" aria-label="検索する">
<svg
viewBox="0 0 24 24"
aria-hidden="true"
>
<circle
cx="10.5"
cy="10.5"
r="6.5"
></circle>
<line
x1="15.5"
y1="15.5"
x2="21"
y2="21"
></line>
</svg>
</button>
</form>
.search-design-03 {
display: flex;
align-items: center;
width: 100%;
max-width: 460px;
height: 52px;
border-bottom: 2px solid #c98792;
}
.search-design-03 input {
flex: 1;
min-width: 0;
padding: 0 8px;
font: inherit;
background: transparent;
border: 0;
outline: none;
}
.search-design-03 input::-webkit-search-cancel-button {
display: none;
}
.search-design-03 button {
display: grid;
place-items: center;
flex: 0 0 48px;
height: 100%;
padding: 0;
background: transparent;
border: 0;
cursor: pointer;
}
.search-design-03 button svg {
display: block;
width: 24px;
height: 24px;
fill: none;
stroke: #c98792;
stroke-width: 1.8;
stroke-linecap: round;
}
.search-design-03 button:hover {
opacity: 0.7;
}
背景色を付けた検索ボックス
入力欄全体に淡い背景色を付けた、やわらかな印象の検索ボックスです。
枠線を使わず背景色で範囲を示しているため、ページになじみやすく、やさしい雰囲気のブログやWebサイトに取り入れやすいデザインです。
<form class="search-design-04" action="/" method="get">
<input
type="search"
name="s"
placeholder="キーワードを入力"
aria-label="サイト内検索"
>
<button type="submit" aria-label="検索する">
<svg
viewBox="0 0 24 24"
aria-hidden="true"
>
<circle
cx="10.5"
cy="10.5"
r="6.5"
></circle>
<line
x1="15.5"
y1="15.5"
x2="21"
y2="21"
></line>
</svg>
</button>
</form>
.search-design-04 {
display: flex;
align-items: center;
width: 100%;
max-width: 460px;
height: 52px;
padding-left: 18px;
background: #f8edef;
border-radius: 12px;
}
.search-design-04 input {
flex: 1;
min-width: 0;
padding: 0;
font: inherit;
background: transparent;
border: 0;
outline: none;
}
.search-design-04 input::-webkit-search-cancel-button {
display: none;
}
.search-design-04 button {
display: grid;
place-items: center;
flex: 0 0 52px;
height: 100%;
padding: 0;
background: transparent;
border: 0;
cursor: pointer;
}
.search-design-04 button svg {
display: block;
width: 24px;
height: 24px;
fill: none;
stroke: #c98792;
stroke-width: 1.8;
stroke-linecap: round;
}
.search-design-04 button:hover {
opacity: 0.7;
}
左側にアイコンを置いた検索ボックス
検索アイコンを入力欄の左側に配置した、分かりやすく使いやすい検索ボックスです。
入力前にアイコンが目に入るため、検索欄であることが伝わりやすく、ヘッダーやサイドバーなどにも取り入れやすいデザインです。
<form class="search-design-05" action="/" method="get">
<button type="submit" aria-label="検索する">
<svg
viewBox="0 0 24 24"
aria-hidden="true"
>
<circle
cx="10.5"
cy="10.5"
r="6.5"
></circle>
<line
x1="15.5"
y1="15.5"
x2="21"
y2="21"
></line>
</svg>
</button>
<input
type="search"
name="s"
placeholder="キーワードを入力"
aria-label="サイト内検索"
>
</form>
.search-design-05 {
display: flex;
align-items: center;
width: 100%;
max-width: 460px;
height: 52px;
background: #ffffff;
border: 1px solid #b9c3d1;
border-radius: 6px;
}
.search-design-05 button {
display: grid;
place-items: center;
flex: 0 0 52px;
height: 100%;
padding: 0;
background: transparent;
border: 0;
cursor: pointer;
}
.search-design-05 button svg {
display: block;
width: 23px;
height: 23px;
fill: none;
stroke: #c98792;
stroke-width: 1.8;
stroke-linecap: round;
}
.search-design-05 input {
flex: 1;
min-width: 0;
padding: 0 16px 0 0;
font: inherit;
background: transparent;
border: 0;
outline: none;
}
.search-design-05 input::-webkit-search-cancel-button {
display: none;
}
.search-design-05 button:hover {
opacity: 0.7;
}
文字ボタン付き検索ボックス
検索アイコンの代わりに、「検索」と書かれたボタンを配置したデザインです。
ボタンの役割が文字で伝わるため、アイコンだけでは操作が分かりにくい場合や、使いやすさを重視したいサイトに適しています。
<form class="search-design-06" action="/" method="get">
<input
type="search"
name="s"
placeholder="キーワードを入力"
aria-label="サイト内検索"
>
<button type="submit">
検索
</button>
</form>
.search-design-06 {
display: flex;
width: 100%;
max-width: 460px;
height: 52px;
overflow: hidden;
background: #ffffff;
border: 1px solid #b9c3d1;
border-radius: 6px;
}
.search-design-06 input {
flex: 1;
min-width: 0;
padding: 0 16px;
font: inherit;
background: transparent;
border: 0;
outline: none;
}
.search-design-06 input::-webkit-search-cancel-button {
display: none;
}
.search-design-06 button {
flex: 0 0 82px;
padding: 0 16px;
font: inherit;
font-weight: 600;
background: #c98792;
border: 0;
cursor: pointer;
}
.search-design-06 button:hover {
opacity: 0.85;
}
装飾で変化を付けた検索ボックスデザイン
背景色や影、ボタンの配置などに変化を付けた検索ボックスを紹介します。
シンプルな形をベースにしながら、ページのアクセントとしても使いやすいデザインをまとめました。
2色を組み合わせた検索ボックス
入力欄と検索ボタンに異なる背景色を使った、2色の検索ボックスです。
色の組み合わせによって検索ボタンの位置が分かりやすく、サイトの配色に合わせて雰囲気を変えられます。
<form class="search-design-07" action="/" method="get">
<input
type="search"
name="s"
placeholder="キーワードを入力"
aria-label="サイト内検索"
>
<button type="submit" aria-label="検索する">
<svg
viewBox="0 0 24 24"
aria-hidden="true"
>
<circle
cx="10.5"
cy="10.5"
r="6.5"
></circle>
<line
x1="15.5"
y1="15.5"
x2="21"
y2="21"
></line>
</svg>
</button>
</form>
.search-design-07 {
display: flex;
width: 100%;
max-width: 460px;
height: 52px;
overflow: hidden;
border-radius: 6px;
}
.search-design-07 input {
flex: 1;
min-width: 0;
padding: 0 18px;
font: inherit;
background: #e9f5fb;
border: 0;
outline: none;
}
.search-design-07 input::-webkit-search-cancel-button {
display: none;
}
.search-design-07 button {
display: grid;
place-items: center;
flex: 0 0 58px;
padding: 0;
background: #c98792;
border: 0;
cursor: pointer;
}
.search-design-07 button svg {
display: block;
width: 24px;
height: 24px;
fill: none;
stroke: #ffffff;
stroke-width: 1.8;
stroke-linecap: round;
}
.search-design-07 button:hover {
opacity: 0.85;
}
検索ボタンを分けた検索ボックス
入力欄と検索ボタンの間に余白を設け、それぞれを独立させた検索ボックスです。
ボタンの位置がはっきり分かるため操作しやすく、余白のあるすっきりとしたレイアウトに合わせやすいデザインです。
<form class="search-design-08" action="/" method="get">
<input
type="search"
name="s"
placeholder="キーワードを入力"
aria-label="サイト内検索"
>
<button type="submit" aria-label="検索する">
<svg
viewBox="0 0 24 24"
aria-hidden="true"
>
<circle
cx="10.5"
cy="10.5"
r="6.5"
></circle>
<line
x1="15.5"
y1="15.5"
x2="21"
y2="21"
></line>
</svg>
</button>
</form>
.search-design-08 {
display: flex;
gap: 10px;
width: 100%;
max-width: 460px;
height: 52px;
}
.search-design-08 input {
flex: 1;
min-width: 0;
padding: 0 16px;
font: inherit;
background: #ffffff;
border: 1px solid #b9c3d1;
border-radius: 6px;
outline: none;
}
.search-design-08 input::-webkit-search-cancel-button {
display: none;
}
.search-design-08 button {
display: grid;
place-items: center;
flex: 0 0 52px;
padding: 0;
background: #c98792;
border: 0;
border-radius: 6px;
cursor: pointer;
}
.search-design-08 button svg {
display: block;
width: 24px;
height: 24px;
fill: none;
stroke: #ffffff;
stroke-width: 1.8;
stroke-linecap: round;
}
.search-design-08 button:hover {
opacity: 0.85;
}
影を付けた検索ボックス
枠線を使わず、検索ボックスの周囲にやわらかな影を付けたデザインです。
背景から少し浮き上がったように見えるため、シンプルさを保ちながら、検索欄の存在を自然に目立たせられます。
<form class="search-design-09" action="/" method="get">
<input
type="search"
name="s"
placeholder="キーワードを入力"
aria-label="サイト内検索"
>
<button type="submit" aria-label="検索する">
<svg
viewBox="0 0 24 24"
aria-hidden="true"
>
<circle
cx="10.5"
cy="10.5"
r="6.5"
></circle>
<line
x1="15.5"
y1="15.5"
x2="21"
y2="21"
></line>
</svg>
</button>
</form>
.search-design-09 {
display: flex;
align-items: center;
width: 100%;
max-width: 460px;
height: 52px;
padding-left: 18px;
background: #ffffff;
border-radius: 8px;
box-shadow: 0 5px 18px rgba(41, 45, 56, 0.14);
}
.search-design-09 input {
flex: 1;
min-width: 0;
padding: 0;
font: inherit;
background: transparent;
border: 0;
outline: none;
}
.search-design-09 input::-webkit-search-cancel-button {
display: none;
}
.search-design-09 button {
display: grid;
place-items: center;
flex: 0 0 52px;
height: 100%;
padding: 0;
background: transparent;
border: 0;
cursor: pointer;
}
.search-design-09 button svg {
display: block;
width: 24px;
height: 24px;
fill: none;
stroke: #c98792;
stroke-width: 1.8;
stroke-linecap: round;
}
.search-design-09 button:hover {
opacity: 0.7;
}
角を切り取った検索ボックス
左右の角を斜めに切り取った、シャープな印象の検索ボックスです。
一般的な四角形や丸みのある形とは異なるため、シンプルな構成のまま、検索欄に少し個性を加えられます。
<form class="search-design-10" action="/" method="get">
<input
type="search"
name="s"
placeholder="キーワードを入力"
aria-label="サイト内検索"
>
<button type="submit" aria-label="検索する">
<svg
viewBox="0 0 24 24"
aria-hidden="true"
>
<circle
cx="10.5"
cy="10.5"
r="6.5"
></circle>
<line
x1="15.5"
y1="15.5"
x2="21"
y2="21"
></line>
</svg>
</button>
</form>
.search-design-10 {
position: relative;
display: flex;
width: 100%;
max-width: 460px;
height: 52px;
padding: 1px;
background: #9ed8f5;
clip-path: polygon(
11px 0,
calc(100% - 11px) 0,
100% 11px,
100% calc(100% - 11px),
calc(100% - 11px) 100%,
11px 100%,
0 calc(100% - 11px),
0 11px
);
}
.search-design-10::before {
position: absolute;
inset: 1px;
content: "";
background: #ffffff;
clip-path: polygon(
10px 0,
calc(100% - 10px) 0,
100% 10px,
100% calc(100% - 10px),
calc(100% - 10px) 100%,
10px 100%,
0 calc(100% - 10px),
0 10px
);
}
.search-design-10 input {
position: relative;
z-index: 1;
flex: 1;
min-width: 0;
padding: 0 16px;
font: inherit;
background: transparent;
border: 0;
outline: none;
}
.search-design-10 input::-webkit-search-cancel-button {
display: none;
}
.search-design-10 button {
position: relative;
z-index: 1;
display: grid;
place-items: center;
flex: 0 0 58px;
padding: 0;
background: transparent;
border: 0;
cursor: pointer;
}
.search-design-10 button svg {
display: block;
width: 26px;
height: 26px;
fill: none;
stroke: #c98792;
stroke-width: 1.8;
stroke-linecap: round;
}
.search-design-10 button:hover {
opacity: 0.7;
}
まとめ
今回は、HTMLとCSSをコピーして使える、おしゃれな検索ボックスデザインを10種類紹介しました。
シンプルな枠線タイプから、丸みのあるデザイン、アイコン付き、背景色や影を使ったデザインまで、さまざまな検索ボックスをまとめています。
色やサイズを変更しながら、サイトの雰囲気や設置する場所に合ったデザインを選んでみてください。
検索ボックス以外の導線も整えたい場合は、ボタンデザインやテキストリンクデザインもあわせてご覧ください。
お気に入りのデザインを取り入れて、情報を探しやすく、使いやすいページ作りに役立ててみてください。
