回答編集履歴

2

chousei

2024/10/07 01:45

投稿

yambejp
yambejp

スコア116810

test CHANGED
@@ -60,21 +60,18 @@
60
60
  display:block;
61
61
  width:100%;
62
62
  }
63
- #inquiryUl li label:has(:checked):before{
63
+ #inquiryUl li label:before{
64
64
  content:"";
65
- background-Image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><rect x="3" y="3" width="14" height="14" stroke-width="3" stroke="white" fill="none" /><polyline points="6,8 9,12 14,8" stroke="white" stroke-width="3" fill="none" /></svg>');
66
65
  width:20px;
67
66
  height:20px;
68
67
  display:inline-block;
69
68
  transform:translateY(4px);
70
69
  }
70
+ #inquiryUl li label:has(:checked):before{
71
+ background-Image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><rect x="3" y="3" width="14" height="14" stroke-width="3" stroke="white" fill="none" /><polyline points="6,8 9,12 14,8" stroke="white" stroke-width="3" fill="none" /></svg>');
72
+ }
71
73
  #inquiryUl li label:not(:has(:checked)):before{
72
- content:"";
73
74
  background-Image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><rect x="3" y="3" width="14" height="14" stroke-width="3" stroke="gray" fill="none" /><polyline points="6,8 9,12 14,8" stroke="gray" stroke-width="3" fill="none" /></svg>');
74
- width:20px;
75
- height:20px;
76
- display:inline-block;
77
- transform:translateY(4px);
78
75
  }
79
76
  #inquiryUl li:has(:checked){
80
77
  background-Color:gray;

1

調整

2024/10/07 01:40

投稿

yambejp
yambejp

スコア116810

test CHANGED
@@ -41,3 +41,56 @@
41
41
  </ul>
42
42
  </div>
43
43
  ```
44
+ # svgバージョン
45
+ 一応SVGバージョンを追記しておきます
46
+ ```html
47
+ <style>
48
+ #inquiryUl{
49
+ list-style:none;
50
+ display:flex;
51
+ flex-wrap:wrap;
52
+ row-gap:10px;
53
+ }
54
+ #inquiryUl li{
55
+ display:block;
56
+ width:60%;
57
+ border:solid 1px lightgray;
58
+ }
59
+ #inquiryUl li label{
60
+ display:block;
61
+ width:100%;
62
+ }
63
+ #inquiryUl li label:has(:checked):before{
64
+ content:"";
65
+ background-Image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><rect x="3" y="3" width="14" height="14" stroke-width="3" stroke="white" fill="none" /><polyline points="6,8 9,12 14,8" stroke="white" stroke-width="3" fill="none" /></svg>');
66
+ width:20px;
67
+ height:20px;
68
+ display:inline-block;
69
+ transform:translateY(4px);
70
+ }
71
+ #inquiryUl li label:not(:has(:checked)):before{
72
+ content:"";
73
+ background-Image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><rect x="3" y="3" width="14" height="14" stroke-width="3" stroke="gray" fill="none" /><polyline points="6,8 9,12 14,8" stroke="gray" stroke-width="3" fill="none" /></svg>');
74
+ width:20px;
75
+ height:20px;
76
+ display:inline-block;
77
+ transform:translateY(4px);
78
+ }
79
+ #inquiryUl li:has(:checked){
80
+ background-Color:gray;
81
+ color:white;
82
+ }
83
+ #inquiryUl [type=radio]{
84
+ display:none;
85
+ }
86
+
87
+ </style>
88
+ <div class="inputarea -first">
89
+ <ul class="chkul" id="inquiryUl">
90
+ <li><label><input type="radio" name="contact" class="list">お問い合わせ</label></li>
91
+ <li><label><input type="radio" name="contact" class="list">資料請求</label></li>
92
+ <li><label><input type="radio" name="contact" class="list">オーナー宅見学申込</label></li>
93
+ <li><label><input type="radio" name="contact" class="list">来場予約</label></li>
94
+ </ul>
95
+ </div>
96
+ ```