2
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?

More than 5 years have passed since last update.

Bootstrapで画面幅に応じて改行する方法<レスポンシブデザイン>

2
Posted at

環境

Bootstrap5
Bootstrap4でも機能すると思います。
3以前は確認してないのでわかりません。ごめんなさい。

やりたいこと

画面が大きいときは1行のテキストを、画面が小さくなると任意の箇所で改行させたい。

やり方

改行させたいところに<br>を挟み、class="d-lg-none"を指定する。
Bootstrapではd-nonedisplay: none;の意味になるので、これで画面幅がlg以上になると<br>が無効になる。

2
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
2
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?