0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WordPressのプラグインEventsManagerの予約フォームをレスポンシブデザインに対応させた

Last updated at Posted at 2021-01-16

前提

  • WordPressバージョン 5.6
  • PHPバージョン 7.4.13
  • Events Managerバージョン 5.9.9

目標

EventsManagerの予約フォームをレスポンシブデザインに対応させる

結論

CSSを追加してなんとかなった(コードは下部)

Before

  • チケットのバグは気にしないお約束

PC表示
スクリーンショット 2021-01-16 133653.png

モバイル表示1
スクリーンショット 2021-01-16 133737.png

モバイル表示2(1より狭い)
スクリーンショット 2021-01-16 133813.png
このようにレスポンシブデザインに対応していない上、最悪表示されないという致命的問題がある。

After

PC表示は変わらず
スクリーンショット 2021-01-16 133939.png

モバイル表示
スクリーンショット 2021-01-16 134040.png
しっかりと表示されていることが分かる

手順

以下CSSを放り込むだけ(のハズ)

style.css
/*アクセスしてきたデバイスのディスプレイ横幅が767px(要調整)以下のとき*/
@media (max-width: 767px){
#em-booking .em-booking-login { /*ログインフォーム左の縦線を非表示*/
    border-left:none;
}

/*微調整*/
#em-booking .em-booking-form-details {
    width:100%;
}

#em-booking .em-booking-form-details input.input,#em-booking .em-booking-form-details textarea {
    width:100%;
}

#em-booking div.em-booking-login{ /*ここが肝*/
    margin:auto;
}
}

#em-booking .em-booking-form label{
    width:100%;
}

#em-booking div.em-booking-login label{
    display:contents;
    width:100%;
}

私の管理しているサイトには VK All in One Expansion Unit が入っていたので、このプラグインで追加される追加CSS機能で追加しました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?