简体   繁体   中英

Ruby on rails App not recognizing stylesheet in assets

I'm trying to add a simple border to some buttons and I can't seem to get it to display.

I have a button module in app/assets/stylesheets/modules/_buttons.scss that I've imported into the application.scss

@import "bootstrap-sprockets";
@import "bootstrap";

//modules 
@import "modules/buttons"; 

button css:

.button {
    border: 1x solid;
    padding: 1em 1.5em; 
} 

And then I added the button class to my header file:

<nav class="navbar navbar-default">
  <div class="container-fluid">
   <a class="navbar-brand" href="#">OpEd</a>
   <ul class="nav navbar-nav navbar-right">
    <li><%= link_to "Share your opinion", new_post_path, class: "button" %></li>
    <% if user_signed_in? %>
    <li><a href= "#"><%= current_user.first_name %></a></li>
    <li><%=link_to "Sign out", destroy_user_session_path, method: :delete %></li>
    <%else%> 
    <li><%= link_to "Sign in / Sign up", new_user_session_path, class: "button" %> </li>
    <%end%>
    </ul>
    </div>
</nav> 

Why is the border not being displayed?

perhaps try and designate a color in your css file? Replacing... border: 1x solid; with

border: 1px solid #e8e8e8; 

Let me know of your result!

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