LoginSignup
1
0

More than 3 years have passed since last update.

【Rails】【bootstrap】レスポンシブに文字の大きさを変更したい

Posted at

前提

gem bootstrapを使用

やりたいこと

Railsを使ってレスポンシブな画面を作る。
その際に文字の大きさをいい感じに大きくしたり小さくしたりしたい。

結論

app/assets/stylesheets/application.scss
body, html { font-size: 30px; }
@media screen and (min-width: 576px) and (max-width: 768px) { body, html { font-size: 30px; } }
@media screen and (min-width: 769px) and (max-width: 992px) { body, html { font-size: 30px; } }
@media screen and (min-width: 993px) and (max-width: 1200px) { body, html { font-size: 16px; } }
@media screen and (min-width: 1201px) { body, html { font-size: 20px; } }

上記のサイズを変更すればOK
色々見ているとpxで設定しない方がよいというのもあるので、他の方法も検討中
今回はRailsというよりはscssの書き方になる

1
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
1
0