検索ボックス CSSデザインサンプル
情報サイトやWordpressの検索ボックスをCSSでデザインします。
- レスポンシブ対応
 - コピペでOK
 - WordPress対応
 
前提
Fontawesomeをインストール
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
デモ
  See the Pen 
  css searchform 1 by kura (@kuranopen)
  on CodePen.
CSS
.searchform .screen-reader-text {
    display: none;
}
.searchform{
    position: relative;
    padding: 0;
    margin: 0 10px 0 0;
    width: 200px;
}
.searchform input{
    line-height: 23px;
    padding: 5px 45px 5px 13px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    border: none;
    font-weight: bold;
    border-radius: 100px;
    outline: none;
}
.searchform #searchsubmit {
    position: absolute;
    top: 1px;
    right: 8px;
    vertical-align: top;
    line-height: 23px;
    border: none;
    border-radius: 3px;
    background: 0 0;
    font-size: 18px;
    cursor: pointer;
    width: 30px;
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    padding: 4px 0px;
}
解説
.searchform .screen-reader-text「検索」の文字を非表示。.searchform横幅とmargin、paddingを調整。.searchform input入力エリアのデザインを調整.searchform #searchsubmit虫眼鏡の検索ボタンのデザインを調整



