東京都府中市、九段下のWEB制作会社Maromaroのブログです

マテリアルなフォーム

  • RESULT
  • HTML
  • CSS
  • Radio_button

    Chack_box

    Pulldown

    file

  • コピー
    <form>
      <div class="msr_text_03">
        <label>Text</label>
        <input type="text" />
      </div>
      <div class="msr_radio_03">
        <p>Radio_button</p>
        <input type="radio" name="msr_radio_tye03" id="msr_03_radio01" />
        <label for="msr_03_radio01">radio1</label>
        <input type="radio" name="msr_radio_tye03" id="msr_03_radio02" />
        <label for="msr_03_radio02">radio2</label>
      </div>
      <div class="msr_chack_03">
        <p>Chack_box</p>
        <input type="checkbox" name="msr_check_tye01" id="msr_03_chack01" />
        <label for="msr_03_chack01">checkbox1</label>
        <input type="checkbox" name="msr_check_tye01" id="msr_03_chack02" />
        <label for="msr_03_chack02">checkbox2</label>
        <input type="checkbox" name="msr_check_tye01" id="msr_03_chack03" />
        <label for="msr_03_chack03">checkbox3</label>
      </div>
      <div class="msr_pulldown_03">
        <p>Pulldown</p>
        <select name="msr_03_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_03">
        <p>file</p>
        <div class="msr_filebox_03">
          <label for="file_photo">画像を選択してください</label>
          <input type="file" id="file_photo">
        </div>
      </div>
      <div class="msr_textarea_03">
          <label>Textarea</label>
          <textarea></textarea>
      </div>
      <p class="msr_sendbtn_03">
        <input type="submit" value="Send">
      </p>
      <p class="msr_sendbtn_03">
        <input type="submit" value="Send" disabled="disabled">
      </p>
    </form>
  • コピー
    /*--------------------------------------
    テキスト
    ---------------------------------------*/
    
    .msr_text_03 {
      padding-bottom: 20px;
      width: 460px;
    }
    .msr_text_03 label {
      display: block;
      font-size: 14px;
      padding-bottom: 5px;
    }
    .msr_text_03 input[type=text] {
      background: #fff;
      border: 1px solid #D7D7D7;
      box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -o-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -ms-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      border-radius: 3px;
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
      font-size: 13px;
      padding: 10px;
      height: 40px;
      width: 460px;
    }
    
    /*--------------------------------------
    ラジオボタン
    ---------------------------------------*/
    
    .msr_radio_03 {
      padding-bottom: 20px;
    }
    .msr_radio_03 p {
      font-size: 14px;
      padding-bottom: 5px;
    }
    .msr_radio_03 input[type=radio] {
      display: none;
      margin: 0;
    }
    .msr_radio_03 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;
    }
    .msr_radio_03 input[type=radio] + label::before {
      border: 1px solid #C3C3C3;
      box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -o-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -ms-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      border-radius: 50%;
      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_03 input[type=radio]:checked + label::after {
      background: #1B73BA;
      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: 0;
      height: 7px;
      width: 7px;
    }
    
    /*--------------------------------------
    チェックボックス
    ---------------------------------------*/
    
    .msr_chack_03 {
      padding-bottom: 20px;
    }
    .msr_chack_03 p {
      font-size: 14px;
      padding-bottom: 5px;
    }
    .msr_chack_03 input[type=checkbox] {
      display: none;
      margin: 0;
    }
    .msr_chack_03 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_03 input[type=checkbox] + label::before {
      border: 1px solid #D7D7D7;
      box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -o-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -ms-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      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: 14px;
      width: 14px;
    }
    .msr_chack_03 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_03 input[type=checkbox]:checked + label::after {
      border-bottom: 3px solid #1B73BA;
      border-left: 3px solid #1B73BA;
      left: 2px;
      margin-top: -6px;
      transform: rotate(-45deg);
      -webkit-transform: rotate(-45deg);
      height: 6px;
      width: 10px;
    }
    
    /*--------------------------------------
    プルダウン
    ---------------------------------------*/
    
    .msr_pulldown_03 {
      padding-bottom: 20px;
      position: relative;
      width: 230px;
    }
    .msr_pulldown_03 p {
      font-size: 14px;
      padding-bottom: 5px;
    }
    .msr_pulldown_03 select {
      appearance: none;
      -moz-appearance: none;
      -ms-appearance: none;
      -webkit-appearance: none;
      background: url(/stylerecipe_img/material_arrow_blue02.png) no-repeat;
      background-position: 210px center;
      border: 1px solid #D7D7D7;
      box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -o-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -ms-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
      cursor: pointer;
      text-indent: .01px;
      text-overflow: "";
      padding: 10px;
      height: 40px;
      width: 230px;
    }
    
    /*--------------------------------------
    ファイル選択
    ---------------------------------------*/
    
    .msr_file_03 {
      padding-bottom: 20px;
      width: 460px;
    }
    .msr_file_03>p {
      font-size: 14px;
      padding-bottom: 5px;
    }
    .msr_filebox_03 input[type=file] {
      display: none;
    }
    .msr_filebox_03 {
      position: relative;
    }
    .msr_filebox_03 label {
      position: relative;
      border: 1px solid #D7D7D7;
      box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -o-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -ms-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      cursor: pointer;
      display: block;
      font-size: 14px;
      padding: 10px;
      height: 20px;
      width: 460px;
    }
    .msr_filebox_03 label:before {
      background: #D7D7D7;
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
      content: "Browse...";
      color: #1B73BA;
      display: inline-block;
      font-size: 14px;
      padding-top: 10px;
      text-align: center;
      position: absolute;
      right: 0;
      top: 0;
      height: 40px;
      width: 100px;
    }
    
    /*--------------------------------------
    テキストエリア
    ---------------------------------------*/
    
    .msr_textarea_03 {
      padding-bottom: 10px;
      width: 460px;
    }
    .msr_textarea_03 label {
      display: block;
      font-size: 14px;
      padding-bottom: 5px;
    }
    .msr_textarea_03 textarea {
      border: 1px solid #D7D7D7;
      box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -o-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -ms-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      box-sizing: border-box;
      -moz-box-sizing: border-box;
      -webkit-box-sizing: border-box;
      font-size: 13px;
      padding: 10px;
      height: 210px;
      width: 460px;
    }
    
    /*--------------------------------------
    送信ボタン
    ---------------------------------------*/
    .msr_sendbtn_03{
      margin:0 0 10px;
    }
    .msr_sendbtn_03 input[type=submit] {
      background: #1B73BA url(/stylerecipe_img/arrow_white.png) no-repeat;
      background-position: 20px;
      border: none;
      border-radius: 2px;
      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;
      box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -o-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -ms-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      -webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
      color: #fff;
      cursor: pointer;
      font-size: 14px;
      height: 50px;
      width: 180px;
    }
    .msr_sendbtn_03 input[type=submit]:hover {
      opacity: 0.6;
    }
    .msr_sendbtn_03 input[disabled=disabled] {
      background: #B4B4B4 url(/stylerecipe_img/arrow_gray.png) no-repeat;
      background-position: 20px;
      color: #7E7E7E;
      cursor: default;
    }
    .msr_sendbtn_03 input[disabled=disabled]:hover {
      opacity: 1;
    }

検証済みブラウザ

  • FF
  • chrome
  • Safari

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

その他のフォーム

Radio_button

Chack_box

Pulldown

file

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

要素一覧