DavidK DavidK - 1 year ago 74
CSS Question

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";

@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>
<li><%= link_to "Sign in / Sign up", new_user_session_path, class: "button" %> </li>

Why is the border not being displayed?

Answer Source

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!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download