teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

本文にコードを記載

2021/02/11 06:03

投稿

退会済みユーザー
title CHANGED
@@ -1,1 +1,1 @@
1
- 【コンタクトフォーム7】textareaにテキスト入力できない動作不良を起こします。原因と改善策が知りたいです。
1
+ 【コンタクトフォーム7】textarea*にテキスト入力できない動作不良を起こします。原因と改善策が知りたいです。
body CHANGED
@@ -1,47 +1,11 @@
1
+ 【設置環境】
1
- wordpressにてテーマはAstra(無料版)を使用し、コンタクトフォームのカスタム設定(カスタムはデザインのみ)で設置したいと思っています。
2
+ wordpressにてテーマはAstra(無料版)を使用
3
+ 自分でも原因と考えられる部分を修正したりネット検索したのですが、解決できず。。。
2
4
 
3
- 【質問内容】
4
- ・textareaが正常に機能せず、本文入力できない原因と改善点が知りたい
5
-
6
-
7
- わたしはHTML5/CSSの基礎知識のみのコーディング初心者です。ネット検索しても該当項目について、検索結果が出てきませんでした。ご教授いただけないでしょうか。
8
-
9
-
10
-
11
- 下記☆がネットで見つけたテンプレート、★がカスタマイズし実際にwordpressに書いたコードです。
12
-
13
- -------------------------------------------------------------------------------
14
-
15
- ☆☆☆テンプレートコード☆☆☆
16
- [テンプレートを引用したサイト](http://fiels-web.com/2019/10/09/contact-form-7-form-customize-template/)
17
- 質問本文の文字数制限があり、テンプレートのコードを直接記載できず申し訳ありません。
18
-
19
-
20
- -------------------------------------------------------------------------------
21
- ★★★自分でカスタマイズしたコード★★★
22
- [https://docs.google.com/document/d/1qZ85SJCXtn0di3Z83u9jsrq7zWGUMXDVV1gYsQ5SksQ/edit?usp=sharing](https://docs.google.com/document/d/1qZ85SJCXtn0di3Z83u9jsrq7zWGUMXDVV1gYsQ5SksQ/edit?usp=sharing)
23
-
24
- 下記は、コンタクトフォームの編集画面に書いたコードです。CSSは質問の文字制限で記載できませんでした。
5
+ コンタクトフォームの編集画面に書いたコードです。※関連個所抜粋
25
-
26
6
  ```
27
- コード
28
7
  <div class="form__wrap template04">
29
- <div class="form__row row-name">
8
+
30
- <p class="form__label is-required"><label for="your-name">氏名</label></p>
31
- <p class="form__body">[text* your-name id:your-name placeholder "氏名"]</p>
32
- </div>
33
- <div class="form__row row-email">
34
- <p class="form__label is-required"><label for="email">メールアドレス</label></p>
35
- <p class="form__body">[email* your-email id:your-email placeholder "sample@sample.com"]</p>
36
- </div>
37
- <div class="form__row row-radio">
38
- <p class="form__label none"><label>ご所属</label></p>
39
- <p class="form__body">[radio radio id:radio use_label_element default:1 "個人" "団体" "法人"]</p>
40
- </div>
41
- <div class="form__row row-checkbox">
42
- <p class="form__label none"><label>ご用件</label></p>
43
- <p class="form__body">[checkbox checkbox id:checkbox use_label_element "お問合わせ" "見積依頼" "ご依頼"]</p>
44
- </div>
45
9
  <div class="form__row row-title">
46
10
  <p class="form__label is-required"><label for="your-subject">件名</label></p>
47
11
  <p class="form__body">[text* your-subject id:your-subject placeholder "件名"]</p>
@@ -50,14 +14,208 @@
50
14
  <p class="form__label is-required"><label for="message">メッセージ本文</label></p>
51
15
  <p class="form__body">[textarea* message id:message placeholder "こちらに詳細をご入力ください"]</p>
52
16
  </div>
53
- <div class="form__row row-privacy">
17
+
54
- <p class="form__body">[acceptance acceptance] <a href="#" target="_blank" rel="noopener noreferrer">プライバシーポリシー</a>に同意する [/acceptance]</p>
55
- </div>
56
- <div class="form__row row-submit">
57
- <div class="submit-btn">[submit id:submit "送 信"]<div class="submit-bg"></div></div>
58
- </div>
59
- </div>
60
18
  ```
61
19
 
20
+ 下記CSSはAstraテーマのCSSカスタマイズにコードを書いています※関連個所抜粋
21
+ ```
22
+ コード
23
+ /* template04 */
24
+ .form__wrap {
25
+ width: 100%;
26
+ max-width: 600px;/*フォームの最大幅*/
27
+ margin-right: auto;
28
+ margin-left: auto;
29
+ }
30
+ .wpcf7 .template04 {
31
+ display: flex;
32
+ flex-wrap: wrap;
33
+ justify-content: space-between;
34
+ color: #464646;
35
+ font-size: 14px;
36
+ margin-bottom:20px;
37
+ }
38
+ .wpcf7 .template04 a {
39
+  margin: 0;
40
+ padding: 0;
41
+ text-decoration: underline;
42
+ color: inherit;
43
+ transition: opacity .25s;
44
+ }
45
+ .wpcf7 .template04 a:hover {
46
+ color:#FE8280;
47
+ transition: opacity .25s;
48
+ }
49
+ .wpcf7 .template04 div.form__row {
50
+ position: relative;
51
+ padding: 0;
52
+ margin: 36px 0px 10px 0px;
53
+ }
54
+ .wpcf7 .template04 div.form__row.row-name,
55
+ .wpcf7 .template04 div.form__row.row-email,
56
+ .wpcf7 .template04 div.form__row.row-title,
57
+ .wpcf7 .template04 div.form__row.row-url {
58
+  width: calc 80%;
59
+ }
60
+ .wpcf7 .template04 div.form__row.row-message {
61
+ width: 100%;
62
+ }
62
63
 
64
+ .wpcf7 .template04 div.form__row.row-checkbox,
65
+ .wpcf7 .template04 div.form__row.row-radio {
66
+ display: flex;
67
+ align-items: center;
68
+ width: 100%;
69
+ }
70
+
71
+ .wpcf7 .template04 div.form__row.row-privacy {
72
+ width: 100%;
73
+ margin-top: 3em;
74
+ text-align: center;
75
+ }
76
+ .wpcf7 .template04 div.form__row.row-submit {
77
+ width: 100%;
78
+ margin-top: 3em;
79
+ text-align: center;
80
+ }
81
+
82
+ .wpcf7 .template04 p.form__label {
83
+ flex-shrink: 0;
84
+ min-width: 136px;
85
+ margin-bottom: 20px;
86
+ padding: 0;
87
+ box-sizing: border-box;
88
+ }
89
+
90
+ .wpcf7 .template04 p.form__body {
91
+ width: 100%;
92
+ margin :0;
93
+ padding:0;
94
+ box-sizing: border-box;
95
+ }
96
+
97
+ .wpcf7 .template04 div.form__row.row-radio p.form__body {
98
+ margin: 0 0 0.6em 2em;
99
+ }
100
+
101
+ .wpcf7 .template04 div.form__row.row-checkbox p.form__body {
102
+ margin: 0 0 1em 2em;
103
+ }
104
+
105
+ .wpcf7 .template04 p.form__label label {
106
+ position: relative;
107
+ margin: 0;
108
+ padding: 0;
109
+ color: #1A6C7A;
110
+ font-size: 14px;
111
+ box-sizing: border-box;
112
+ }
113
+ .wpcf7 .template04 p.form__label.is-required label {
114
+ margin-right: 1em;
115
+ }
116
+ .wpcf7 .template04 p.form__label.is-required label::before {
117
+ content: "必須";
118
+ margin-right:4px;
119
+ letter-spacing:0.4px;
120
+ color: #ffffff;
121
+ background-color:#FE8280;
122
+ font-size:12px;
123
+ padding:0px 2px 0px 2px;
124
+ border-radius:2px;
125
+ }
126
+
127
+ .wpcf7 .template04 p.form__label.none label::before {
128
+ content: "〇〇";
129
+ margin-right:4px;
130
+ letter-spacing:0.4px;
131
+ color: #ffffff;
132
+ font-size:12px;
133
+ padding:0px 2px 0px 2px;
134
+ border-radius:2px;
135
+ }
136
+
137
+ /* テキストフィールド */
138
+ .wpcf7 .template04 input[type=text],
139
+ .wpcf7 .template04 input[type=title],
140
+ .wpcf7 .template04 input[type=email],
141
+ .wpcf7 .template04 input[type=url],
142
+ {
143
+ width: 100%;
144
+ margin: 0;
145
+ padding: .2em 0;
146
+ border: 0;
147
+ border-bottom: 1px solid #d8d8d8;
148
+ border-radius: 0;
149
+ box-shadow: none;
150
+ background-color: transparent;
151
+ color: inherit;
152
+ font-family: inherit;
153
+ font-weight:inherit ;
154
+ font-size: inherit;
155
+ box-sizing: border-box;
156
+ -webkit-appearance: none;
157
+ -moz-appearance: none;
158
+ appearance: none;
159
+ }
160
+
161
+ .wpcf7 .template04 textarea {
162
+ width: 100%;
163
+ height: 100px;
164
+  margin: 0;
165
+ padding: 20px 0 .2em 0;
166
+ border: 0;
167
+ border-bottom: 1px solid #d8d8d8;
168
+ border-radius: 0;
169
+ box-shadow: none;
170
+ background-color: transparent;
171
+ color: inherit;
172
+ font-family: inherit;
173
+ font-weight: inherit;
174
+ font-size: inherit;
175
+ box-sizing: border-box;
176
+ -webkit-appearance: none;
177
+ -moz-appearance: none;
178
+ appearance: none;
179
+ }
180
+
181
+ /* テキストフィールド placeholder */
182
+ .wpcf7 .template04 input[type=text]::placeholder,
183
+ .wpcf7 .template04 input[type=title]::placeholder,
184
+ .wpcf7 .template04 input[type=email]::placeholder,
185
+ .wpcf7 .template04 input[type=url]::placeholder,
186
+ .wpcf7 .template04 textarea::placeholder {
187
+ opacity: 0.3;
188
+ display: none;
189
+ padding-left:36px;
190
+ }
191
+
192
+ .wpcf7 .template04 textarea::placeholder {
193
+ padding-top:6px;
194
+ }
195
+
196
+ .wpcf7 .template04 input[type=text]:-ms-input-placeholder,
197
+ .wpcf7 .template04 input[type=email]:-ms-input-placeholder,
198
+ .wpcf7 .template04 input[type=url]:-ms-input-placeholder,
199
+ .wpcf7 .template04 textarea:-ms-input-placeholder{
200
+ opacity: 0;
201
+ display: none;
202
+ }
203
+
204
+ .wpcf7 .template04 input[type=text]::-ms-input-placeholder,
205
+ .wpcf7 .template04 input[type=email]::-ms-input-placeholder,
206
+ .wpcf7 .template04 input[type=url]::-ms-input-placeholder,
207
+ .wpcf7 .template04 textarea::-ms-input-placeholder,{
208
+ opacity: 0;
209
+ display: none;
210
+ }
211
+
212
+ /* テキストフィールド フォーカス時 */
213
+ .wpcf7 .template04 input[type=text]:focus,
214
+ .wpcf7 .template04 input[type=email]:focus,
215
+ .wpcf7 .template04 input[type=url]:focus,
216
+ .wpcf7 .template04 textarea:focus {
217
+ padding: 2px 0px 2px 36px;
218
+
219
+ }
220
+ ```
63
221
  何卒、よろしくお願い致します。

1

質問事項を減らし、書いたコードを記載しました

2021/02/11 06:03

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  【質問内容】
4
4
  ・textareaが正常に機能せず、本文入力できない原因と改善点が知りたい
5
- ・textarea以外の入力箇所にカーソルを持っていくと止まれ標識が表示されるのを直したい(入力は正常にできる)
6
5
 
7
6
 
8
7
  わたしはHTML5/CSSの基礎知識のみのコーディング初心者です。ネット検索しても該当項目について、検索結果が出てきませんでした。ご教授いただけないでしょうか。
@@ -22,5 +21,43 @@
22
21
  ★★★自分でカスタマイズしたコード★★★
23
22
  [https://docs.google.com/document/d/1qZ85SJCXtn0di3Z83u9jsrq7zWGUMXDVV1gYsQ5SksQ/edit?usp=sharing](https://docs.google.com/document/d/1qZ85SJCXtn0di3Z83u9jsrq7zWGUMXDVV1gYsQ5SksQ/edit?usp=sharing)
24
23
 
24
+ 下記は、コンタクトフォームの編集画面に書いたコードです。CSSは質問の文字制限で記載できませんでした。
25
25
 
26
+ ```
27
+ コード
28
+ <div class="form__wrap template04">
29
+ <div class="form__row row-name">
30
+ <p class="form__label is-required"><label for="your-name">氏名</label></p>
31
+ <p class="form__body">[text* your-name id:your-name placeholder "氏名"]</p>
32
+ </div>
33
+ <div class="form__row row-email">
34
+ <p class="form__label is-required"><label for="email">メールアドレス</label></p>
35
+ <p class="form__body">[email* your-email id:your-email placeholder "sample@sample.com"]</p>
36
+ </div>
37
+ <div class="form__row row-radio">
38
+ <p class="form__label none"><label>ご所属</label></p>
39
+ <p class="form__body">[radio radio id:radio use_label_element default:1 "個人" "団体" "法人"]</p>
40
+ </div>
41
+ <div class="form__row row-checkbox">
42
+ <p class="form__label none"><label>ご用件</label></p>
43
+ <p class="form__body">[checkbox checkbox id:checkbox use_label_element "お問合わせ" "見積依頼" "ご依頼"]</p>
44
+ </div>
45
+ <div class="form__row row-title">
46
+ <p class="form__label is-required"><label for="your-subject">件名</label></p>
47
+ <p class="form__body">[text* your-subject id:your-subject placeholder "件名"]</p>
48
+ </div>
49
+ <div class="form__row row-message">
50
+ <p class="form__label is-required"><label for="message">メッセージ本文</label></p>
51
+ <p class="form__body">[textarea* message id:message placeholder "こちらに詳細をご入力ください"]</p>
52
+ </div>
53
+ <div class="form__row row-privacy">
54
+ <p class="form__body">[acceptance acceptance] <a href="#" target="_blank" rel="noopener noreferrer">プライバシーポリシー</a>に同意する [/acceptance]</p>
55
+ </div>
56
+ <div class="form__row row-submit">
57
+ <div class="submit-btn">[submit id:submit "送 信"]<div class="submit-bg"></div></div>
58
+ </div>
59
+ </div>
60
+ ```
61
+
62
+
26
63
  何卒、よろしくお願い致します。