简体   繁体   中英

Bootstrap Rails 5 not styling my app

I just installed bootstrap into my rails project and followed all their instructions on their GitHub page but now only certain elements are getting bootstrap styled. I can style the links with btn btn-primary but btn btn-default doesn't work.

Also, when I try:

<ul class="nav nav-pills">
    <li><a href="#">Home</a></li>
    <li><a href="#">Home2</a></li>
    <li><a href="#">Home3</a></li>
</ul>

It doesn't style this list fully.

在此处输入图片说明

Here is my gemfile :

gem 'bootstrap', '~> 4.0.0.alpha6'
source 'https://rails-assets.org' do
  gem 'rails-assets-tether', '>= 1.3.3'
end

And i did do this in my Application.css.scss :

@import "bootstrap";

Add this gem into your gemfile :

gem 'bootstrap-sass', '~> 3.3.6'
gem 'sass-rails', '>= 3.2'

app/assets/stylesheets/application.scss

// "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables"
@import "bootstrap-sprockets";
@import "bootstrap";

references: https://github.com/twbs/bootstrap-sass

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM