東京都府中市、渋谷区のWEB制作会社Maromaroのブログです

無難なフォーム

  • RESULT
  • HTML
  • CSS
  • Radio_button

    Chack_box

    Pulldown

    file

  • コピー
    <form>
      <div class="msr_text_01">
        <label>Text</label>
        <input type="text" />
      </div>
      <div class="msr_radio_01">
        <p>Radio_button</p>
        <input type="radio" name="msr_radio_tye01" id="msr_01_radio01" />
        <label for="msr_01_radio01">radio1</label>
        <input type="radio" name="msr_radio_tye01" id="msr_01_radio02" />
        <label for="msr_01_radio02">radio2</label>
      </div>
      <div class="msr_chack_01">
        <p>Chack_box</p>
        <input type="checkbox" name="msr_check_tye01" id="msr_01_chack01" />
        <label for="msr_01_chack01">checkbox1</label>
        <input type="checkbox" name="msr_check_tye01" id="msr_01_chack02" />
        <label for="msr_01_chack02">checkbox2</label>
        <input type="checkbox" name="msr_check_tye01" id="msr_01_chack03" />
        <label for="msr_01_chack03">checkbox3</label>
      </div>
      <div class="msr_pulldown_01">
        <p>Pulldown</p>
        <select name="msr_01_pulldown01">
          <option value="">選択してください</option>
          <option value="test1">test1</option>
          <option value="test2">test2</option>
          <option value="test3">test3</option>
          <option value="test4">test4</option>
          <option value="test5">test5</option>
        </select>
      </div>
      <div class="msr_file_01">
        <p>file</p>
        <div class="msr_filebox_01">
          <label for="file_photo"> 画像を選択してください</label>
          <input type="file" id="file_photo">
        </div>
      </div>
      <div class="msr_textarea_01">
        <label>Textarea</label>
        <textarea></textarea>
      </div>
      <p class="msr_sendbtn_01">
        <input type="submit" value="Send">
      </p>
      <p class="msr_sendbtn_01">
        <input type="submit" value="Send" disabled="disabled">
      </p>
    </form>
    
  • コピー
    /*--------------------------------------
    テキスト
    ---------------------------------------*/
    
    .msr_text_01 {
      padding-bottom: 20px;
      width: 460px;
    }
    .msr_text_01 label {
      display: block;
      font-size: 14px;
      padding-bottom: 5px;
    }
    .msr_text_01 input[type=text] {
      border: 1px solid #AAAAAA;
      box-sizing: border-box;
      box-shadow: 1px 1px 1px 1px #E1E1E1 inset;
      -moz-box-shadow: 1px 1px 1px 1px #E1E1E1 inset;
      -webkit-box-shadow: 1px 1px 1px 1px #E1E1E1 inset;
      font-size: 13px;
      height: 25px;
      padding-left: 8px;
      width: 460px;
    }
    
    /*--------------------------------------
    ラジオボタン
    ---------------------------------------*/
    
    .msr_radio_01 {
      padding-bottom: 20px;
    }
    .msr_radio_01 p {
      font-size: 14px;
      padding-bottom: 5px;
    }
    .msr_radio_01 input[type=radio] {
      display: none;
      margin: 0;
    }
    .msr_radio_01 input[type=radio] + label {
      cursor: pointer;
      display: inline-block;
      font-size: 13px;
      line-height: 1.5px;
      margin-right: 12px;
      padding: 0 0 3px 24px;
      position: relative;
      vertical-align: middle;
    }
    .msr_radio_01 input[type=radio] + label::before {
      background: linear-gradient(#FEFEFE, #F3F5F5);
      background: -o-linear-gradient(#FEFEFE, #F3F5F5);
      background: -ms-linear-gradient(#FEFEFE, #F3F5F5);
      background: -moz-linear-gradient(#FEFEFE, #F3F5F5);
      background: -webkit-linear-gradient(#FEFEFE, #F3F5F5);
      background: -webkit-gradient(linear, left top, left bottom, color-stop(1.00, #F3F5F5), color-stop(0.00, #FEFEFE));
      border: 1px solid #AAAAAA;
      border-radius: 50%;
      box-shadow: 0px 0px 1px 1px #E1E1E1;
      -moz-box-shadow: 0px 0px 1px 1px #E1E1E1;
      -webkit-box-shadow: 0px 0px 1px 1px #E1E1E1;
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
      content: "";
      display: block;
      margin-top: -9px;
      position: absolute;
      left: 0;
      top: 50%;
      height: 13px;
      width: 13px;
    }
    .msr_radio_01 input[type=radio]:checked + label::after {
      background: linear-gradient(#1F85D8, #17619C);
      background: -o-linear-gradient(#1F85D8, #17619C);
      background: -ms-linear-gradient(#1F85D8, #17619C);
      background: -moz-linear-gradient(#1F85D8, #17619C);
      background: -webkit-linear-gradient(#1F85D8, #17619C);
      background: -webkit-gradient(linear, left top, left bottom, color-stop(1.00, #17619C), color-stop(0.00, #1F85D8));
      border-radius: 50%;
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
      content: "";
      display: block;
      margin-top: -4px;
      position: absolute;
      left: 3px;
      top: 0px;
      height: 7px;
      width: 7px;
    }
    
    /*--------------------------------------
    チェックボックス
    ---------------------------------------*/
    
    .msr_chack_01 {
      padding-bottom: 20px;
    }
    .msr_chack_01 p {
      font-size: 14px;
      padding-bottom: 5px;
    }
    .msr_chack_01 input[type=checkbox] {
      display: none;
      margin: 0;
    }
    .msr_chack_01 input[type=checkbox] + label {
      cursor: pointer;
      display: inline-block;
      font-size: 13px;
      line-height: 1.5px;
      margin-right: 12px;
      padding: 0 0 0 24px;
      position: relative;
    }
    .msr_chack_01 input[type=checkbox] + label::before {
      background: linear-gradient(#FEFEFE, #F3F5F5);
      background: -o-linear-gradient(#FEFEFE, #F3F5F5);
      background: -ms-linear-gradient(#FEFEFE, #F3F5F5);
      background: -moz-linear-gradient(#FEFEFE, #F3F5F5);
      background: -webkit-linear-gradient(#FEFEFE, #F3F5F5);
      background: -webkit-gradient(linear, left top, left bottom, color-stop(1.00, #F3F5F5), color-stop(0.00, #FEFEFE));
      border: 1px solid #AAAAAA;
      border-radius: 2px;
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
      box-shadow: 0px 0px 1px 1px #E1E1E1;
      -webkit-box-shadow: 0px 0px 1px 1px #E1E1E1;
      -moz-box-shadow: 0px 0px 1px 1px #E1E1E1;
      content: "";
      display: block;
      margin-top: -9px;
      position: absolute;
      left: 0;
      top: 50%;
      height: 14px;
      width: 14px;
    }
    .msr_chack_01 input[type=checkbox]:checked + label::after {
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
      content: "";
      display: block;
      position: absolute;
      top: 50%;
    }
    .msr_chack_01 input[type=checkbox]:checked + label::after {
      left: 3px;
      margin-top: -7px;
      border-bottom: 2px solid #1B73BA;
      border-left: 2px solid #1B73BA;
      transform: rotate(-45deg);
      -webkit-transform: rotate(-45deg);
      height: 6px;
      width: 9px;
    }
    
    /*--------------------------------------
    プルダウン
    ---------------------------------------*/
    
    .msr_pulldown_01 {
      padding-bottom: 20px;
      position: relative;
      width: 160px;
    }
    .msr_pulldown_01 label {
      font-size: 14px;
      padding-bottom: 5px;
    }
    .msr_pulldown_01 select {
      appearance: none;
      -moz-appearance: none;
      -webkit-appearance: none;
      background: url(/stylerecipe_img/msr01_pulldown_btn01.png) no-repeat right;
      border: 1px solid #AAAAAA;
      box-shadow: 1px 1px 1px 1px #E1E1E1 inset;
      -moz-box-shadow: 1px 1px 1px 1px #E1E1E1 inset;
      -webkit-box-shadow: 1px 1px 1px 1px #E1E1E1 inset;
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
      cursor: pointer;
      text-indent: .01px;
      text-overflow: "";
      height: 25px;
      padding-left: 8px;
      width: 160px;
    }
    
    /*--------------------------------------
    ファイル選択
    ---------------------------------------*/
    
    .msr_file_01 {
      padding-bottom: 20px;
      width: 460px;
    }
    .msr_file_01>p {
      font-size: 14px;
      padding-bottom: 5px;
    }
    .msr_filebox_01 {
      position: relative;
    }
    .msr_filebox_01 input[type=file] {
      display: none;
    }
    .msr_filebox_01 label {
      border: 1px solid #AAAAAA;
      box-shadow: 1px 1px 1px 1px #E1E1E1 inset;
      -moz-box-shadow: 1px 1px 1px 1px #E1E1E1 inset;
      -webkit-box-shadow: 1px 1px 1px 1px #E1E1E1 inset;
      cursor: pointer;
      font-size: 14px;
      display: block;
      position: relative;
      padding: 3px 0 0 8px;
      height: 22px;
      width: 400px;
      vertical-align: middle;
    }
    .msr_filebox_01 label:before {
      background: url(/stylerecipe_img/msr01_file_btn01.png) no-repeat;
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
      content: "Browse...";
      display: inline-block;
      font-size: 14px;
      padding-top: 3px;
      text-align: center;
      position: absolute;
      right: 0;
      top: 0;
      height: 25px;
      width: 99px;
    }
    
    /*--------------------------------------
    テキストエリア
    ---------------------------------------*/
    
    .msr_textarea_01 {
      padding-bottom: 10px;
      width: 460px;
    }
    .msr_textarea_01 label {
      display: block;
      font-size: 14px;
      padding-bottom: 5px;
    }
    .msr_textarea_01 textarea {
      border: 1px solid #AAAAAA;
      box-shadow: 1px 1px 1px 1px #E1E1E1 inset;
      -moz-box-shadow: 1px 1px 1px 1px #E1E1E1 inset;
      -webkit-box-shadow: 1px 1px 1px 1px #E1E1E1 inset;
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
      font-size: 13px;
      height: 210px;
      width: 460px;
      padding: 8px;
    }
    
    /*--------------------------------------
    送信ボタン
    ---------------------------------------*/
    .msr_sendbtn_01{
      margin:0 0 10px;
    }
    .msr_sendbtn_01 input[type=submit] {
      background: linear-gradient(#FEFEFE, #F3F5F5);
      background: -o-linear-gradient(#FEFEFE, #F3F5F5);
      background: -ms-linear-gradient(#FEFEFE, #F3F5F5);
      background: -moz-linear-gradient(#FEFEFE, #F3F5F5);
      background: -webkit-linear-gradient(#FEFEFE, #F3F5F5);
      background: -webkit-gradient(linear, left top, left bottom, color-stop(1.00, #F3F5F5), color-stop(0.00, #FEFEFE));
      background: url(/stylerecipe_img/arrow_blue.png) no-repeat;
      background-position: 10px;
      border: 1px solid #AAAAAA;
      color: #333333;
      cursor: pointer;
      font-size: 14px;
      font-weight: bold;
      transition: 0.2s ease-in-out;
      -o-transition: 0.2s ease-in-out;
      -moz-transition: 0.2s ease-in-out;
      -webkit-transition: 0.2s ease-in-out;
      height: 30px;
      width: 140px;
    }
    .msr_sendbtn_01 input[type=submit]:hover {
      opacity: 0.6;
    }
    .msr_sendbtn_01 input[disabled=disabled] {
      background: url(/stylerecipe_img/arrow_gray.png) no-repeat;
      background-position: 10px;
      color: #999999;
      cursor: default;
    }
    .msr_sendbtn_01 input[disabled=disabled]:hover {
      opacity: 1;
    }

検証済みブラウザ

  • FF
  • chrome
  • Safari

画像へのパスは任意のものに書き換えてください!
使用している画像はこちら

その他のフォーム

Radio_button

Chack_box

Pulldown

file

スタイリッシュなフォーム
フォームの一覧をもっと見る

要素一覧