LoginSignup
0
0

More than 3 years have passed since last update.

wordpressのcontact form 7 でドロップダウンメニューに透かし文字入れたい

Posted at

Contact Form 7

お問い合わせフォームを作るとき大変便利ですね。

便利なんですが...optgroupは無いのね。

という訳で、何とかしてドロップダウンメニューに透かし文字でグループ入れましょう!!

例として都道府県で作ってみます。

まずは、フォームからドロップダウンメニューを選択。

htmlと同じように書きます。

optgroupグループの先頭につけます。
endoptgroup

下記のように記述します。

選択して下さい
optgroup-北海道東北地方
 北海道
 青森県
 岩手県
 宮城県
 秋田県
 山形県
 福島県
endoptgroup
optgroup-関東地方
 茨城県
 栃木県
 群馬県
 埼玉県
 千葉県
 東京都
 神奈川県
endoptgroup
optgroup-中部地方
 新潟県
 富山県
 石川県
 福井県
 山梨県
 長野県
 岐阜県
 静岡県
 愛知県
endoptgroup
optgroup-近畿地方
 三重県
 滋賀県
 京都府
 大阪府
 兵庫県
 奈良県
 和歌山県
endoptgroup
optgroup-中国地方
 鳥取県
 島根県
 岡山県
 広島県
 山口県
endoptgroup
optgroup-四国地方
 徳島県
 香川県
 愛媛県
 高知県
endoptgroup
optgroup-九州沖縄地方
 福岡県
 佐賀県
 長崎県
 熊本県
 大分県
 宮崎県
 鹿児島
endoptgroup

グループにしたい部分を

optgroup-北海道東北地方

~グループにしたい奴ら~

endoptgroup

のようにして記述します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0