Adam Zerner
Adam Zerner

Reputation: 19278

bootstrap icons not working

I'm trying to use these icons for my site. I already downloaded bootstrap, and have a bootstrap.css file. If I download all of bootstrap, it messes my site up, so I downloaded a customized version. I forgot to download the icons, so what I did was download a customized bootstrap with only the icons, and then copy and pasted that into my old bootstrap.css file. However, the icon I was trying to use didn't work.

So then what I did was I tried moving my old bootstrap.css file out of vendor/assets/stylesheets and into vendor/assets, and I put the new bootstrap.css file (with only the icons styling) into vendor/assets/stylesheets. When I did that, the icon still didn't show. So I removed the new bootstrap.css file, and I put the old one back into vender/assets/stylesheets. However... now none of the bootstrap styling works!!! I have no clue why that is!

I tried restarting my web server, clearing my cache, I checked to see if there is an assets folder in my public folder (because when there is I can't see css changes using localhost. something to do with compiling). None of it worked, and I still can't see any of the bootstrap styling in my localhost. When I use inspect element, I don't see the bootstrap styles being applied. I'm afraid to update the actual site, because I might loose the bootstrap styling. If you want me to update it so you can see it and help me and are confident that I won't lose the bootstrap styling, I'll trust you and do it. Let me know.

Error:

Sass::SyntaxError in Static_pages#home

Showing /Users/adamzerner/collegeanswerz/app/views/static_pages/home.html.erb where line #1 raised:

Invalid CSS after "...ground-position": expected ";", was ": center;"
  (in /Users/adamzerner/collegeanswerz/app/assets/stylesheets/home.css.scss)
Extracted source (around line #1):

1: <%= stylesheet_link_tag    "home", :media => "all" %>
2: <%= javascript_include_tag :application %>
3: <% provide(:title, 'Questions About College?  CollegeANSWERZ') %>
4: 
Rails.root: /Users/adamzerner/collegeanswerz

Application Trace | Framework Trace | Full Trace
app/assets/stylesheets/bootstrap.css:1939
app/assets/stylesheets/home.css.scss:1
app/views/static_pages/home.html.erb:1:in `_app_views_static_pages_home_html_erb__737002310770935096_70160250580000'
Request

Parameters:

None
Show session dump

Show env dump

Response

Headers:

None

Upvotes: 1

Views: 2501

Answers (1)

Sushil
Sushil

Reputation: 501

If you are using ruby on rails, then you can use the bootstrap-sass gem.

gem 'bootstrap-sass'

and then start using it by adding

@import bootstrap;

to the css file under app/assets/stylesheets. You can have all the functions provided by bootstrap.

But if you still want the customized version, you can place the bootstrap css files under app/assets/stylesheets and javascript files under app/assets/javascripts and images under app/assets/images. You can download the missing images from bootstrap and then go to /img for the images.

EDIT: Looking at your error logs and the css you have provided in the comment. You have forgotten the semicolon after the background-image: url("glyphicons-halflings.png");

Upvotes: 1

Related Questions