6
7

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.

RailsのBootstrap導入、かつレスポンシブデザインを無効にする

Last updated at Posted at 2012-11-22

レスポンシブデザインは画面の大きさ(パソコン、タブレット、スマホ)によって表示を変えるBootstrapの素晴らしい技術です。

ですが、時としてその挙動を望まない場合があります。
RailsのBootstrapではデフォルトでこのレスポンシブデザインが入っていて何とか無効にしたいと。

そんな時は以下のファイルを修正して下さい

その前にBootstrapの導入方法について

Gemfile
gem 'twitter-bootstrap-rails'
bundle install
rails g bootstrap:install

ここで(可変レイアウト)テンプレートを作成する場合は

rails g bootstrap:layout application (fluid)

そしてレスポンシブデザインが読み込まれているところは

app/assets/stylesheets/bootstrap_and_overrides.css.less
@import "twitter/bootstrap/responsive";

ここをコメントもしくは削除することでレスポンシブデザインを無効にすることができます
めでたしめでたし。

6
7
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
6
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?