スタイリッシュなフォーム
- RESULT
- HTML
- CSS
- コピー
<form> <div class="msr_text_05"> <label>Text</label> <input type="text" /> </div> <div class="msr_radio_05"> <p>Radio_button</p> <input type="radio" name="msr_radio_tye03" id="msr_05_radio01" /> <label for="msr_05_radio01">Radio1</label> <input type="radio" name="msr_radio_tye03" id="msr_05_radio02" /> <label for="msr_05_radio02">Radio2</label> </div> <div class="msr_chack_05"> <p>Chack_box</p> <input type="checkbox" name="msr_05_chack01" id="msr_05_chack01" /> <label for="msr_05_chack01">Checkbox1</label> <input type="checkbox" name="msr_05_chack01" id="msr_05_chack02" /> <label for="msr_05_chack02">Checkbox2</label> <input type="checkbox" name="msr_05_chack01" id="msr_05_chack03" /> <label for="msr_05_chack03">Checkbox3</label> </div> <div class="msr_pulldown_05"> <p>Pulldown</p> <label> <select> <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> </label> </div> <div class="msr_file_05"> <p>file</p> <label for="file_photo"> 画像を選択してください <input type="file" id="file_photo"> </label> </div> <div class="msr_textarea_05"> <label>Textarea</label> <textarea></textarea> </div> <p class="msr_sendbtn_05"> <input type="submit" value="Send"> </p> <p class="msr_sendbtn_05"> <input type="submit" value="Send" disabled="disabled"> </p> </form>
- コピー
/*-------------------------------------- テキスト ---------------------------------------*/ .msr_text_05 { padding-bottom: 20px; width: 460px; } .msr_text_05 label { display: block; font-size: 14px; padding-bottom: 5px; } .msr_text_05 input[type=text] { background: #fff; border: 1px solid #999999; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; font-size: 14px; padding: 10px; height: 40px; width: 460px; } /*-------------------------------------- ラジオボタン ---------------------------------------*/ .msr_radio_05 { padding-bottom: 20px; } .msr_radio_05 p { font-size: 14px; padding-bottom: 5px; } .msr_radio_05 input[type=radio] { display: none; margin: 0; } .msr_radio_05 input[type=radio] + label { cursor: pointer; display: inline-block; font-size: 14px; line-height: 1.5px; margin-right: 12px; padding: 0 0 0px 24px; position: relative; } .msr_radio_05 input[type=radio] + label::before { border: 1px solid #777777; 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: 16px; width: 16px; } .msr_radio_05 input[type=radio]:checked + label::after { background: #333333; 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: 4px; top: 0; height: 8px; width: 8px; } /*-------------------------------------- チェックボックス ---------------------------------------*/ .msr_chack_05 { padding-bottom: 20px; } .msr_chack_05 p { font-size: 14px; padding-bottom: 5px; } .msr_chack_05 input[type=checkbox] { display: none; margin: 0; } .msr_chack_05 input[type=checkbox] + label { cursor: pointer; display: inline-block; font-size: 14px; line-height: 1.5px; margin-right: 12px; padding: 0 0 0 24px; position: relative; } .msr_chack_05 input[type=checkbox] + label::before { border: 1px solid #999999; 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: 16px; width: 16px; } .msr_chack_05 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_05 input[type=checkbox]:checked + label::after { border-bottom: 1px solid #333333; border-left: 1px solid #333333; left: 3px; margin-top: -6px; transform: rotate(-45deg); -webkit-transform: rotate(-45deg); height: 6px; width: 10px; } /*-------------------------------------- プルダウン ---------------------------------------*/ .msr_pulldown_05 { padding-bottom: 20px; position: relative; width: 230px; } .msr_pulldown_05 p { font-size: 14px; padding-bottom: 5px; } .msr_pulldown_05 select { appearance: none; -moz-appearance: none; -ms-appearance: none; -webkit-appearance: none; background:#FFFFFF; border: 1px solid #999999; border-radius: 0; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; cursor: pointer; padding: 10px; position:relative; height: 40px; width: 230px; } .msr_pulldown_05 label{ position:relative; } .msr_pulldown_05 label::after { content:""; border-bottom: 1px solid #333333; border-left: 1px solid #333333; right: 16px; height: 8px; margin-top: -5px; transform: rotate(-45deg); -webkit-transform: rotate(-45deg); position:absolute; top:50%; width: 8px; } /*-------------------------------------- ファイル選択 ---------------------------------------*/ .msr_file_05 { padding-bottom: 20px; width: 460px; } .msr_file_05 label { border: 1px solid #999999; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; cursor: pointer; display:block; font-size:14px; padding: 10px; position:relative; height: 40px; width: 230px; } .msr_file_05 label::before { content:"+"; color:#333333; font-size:20px; line-height:1; margin-top: -9px; right:10px; position:absolute; top:50%; } .msr_file_05 input[type=file] { display: none; } /*-------------------------------------- テキストエリア ---------------------------------------*/ .msr_textarea_05 { padding-bottom: 10px; width: 460px; } .msr_textarea_05 label { display: block; font-size: 14px; padding-bottom: 5px; } .msr_textarea_05 textarea { border: 1px solid #999999; 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_05{ margin:0 0 10px; } .msr_sendbtn_05 input[type=submit] { background-color: #FFFFFF; border:1px solid #999999; border-radius: 2px; color: #333333; cursor:pointer; display: block; font-size: 14px; padding: 14px; text-align: center; text-decoration: none; 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; width: 180px; } .msr_sendbtn_05 input[type=submit]:hover { background-color: #999999; color: #FFFFFF; } .msr_sendbtn_05 input[disabled=disabled] { cursor:default; opacity: 0.5; } .msr_sendbtn_05 input[disabled=disabled]:hover { background-color: #FFFFFF; color: #333333; }
検証済みブラウザ
- Edge
- FF
- chrome
- Safari