我的整个rails应用程序只是从一个文件css为什么 [英] my whole rails app is getting css only from one file why

查看:157
本文介绍了我的整个rails应用程序只是从一个文件css为什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为这两个控制器添加了不同的css文件,但我的整个应用程序只是从 product.css

I had added different css files for both the controllers but my whole app is only taking css from the product.css

我为两个控制器添加了不同的css文件,但我的整个应用程序只是从 product.css
采取css我添加了不同的css文件对于两个控制器,但我的整个应用程序只采取css从 product.css

I had added different css files for both the controllers but my whole app is only taking css from the product.css I had added different css files for both the controllers but my whole app is only taking css from the product.css

产品。 css

body {
    font-size: 11px;
    font-family: 'Open Sans', sans-serif;
    color: #4A4A4A ;
    text-align: center;
}

.wrap {
    background: #fff;
    margin: 20px auto;
    display: block;
    width: 300px;
    height: 380px;
    padding:20px;
    border-radius: 2px 2px 2px 2px; 
    -webkit-box-shadow: 0 1px 4px 
    rgba(0, 0, 0, 0.3), 0 0 40px 
    rgba(0, 0, 0, 0.1) inset;
    -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
    box-shadow: 0 1px 4px 
    rgba(0, 0, 0, 0.3), 0 0 40px 
    rgba(0, 0, 0, 0.1) inset;
    float: left;
    margin-right: 29px;
}

.wrap img {
    width: 100%;
    margin-top: 15px;
}

p{ 
    margin-top: 15px;
    text-align: justify;
}

h1{
    font-size: 20px;
    font-weight: bold;
    margin-top: 5px; 
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

a{
    text-decoration: none;
    color: #4A4A4A !important;
}

a:hover{
    text-decoration: underline;
    color: #6B6B6B !important ;
}

**

推荐答案

好的,你使用SCSS混合CSS,我的建议是将product.css更改为product.scss,并使用

Okay you're using SCSS mixed with CSS, my advice would be to change product.css into product.scss and import the paths using

 @import '/*';
 @import '/**/*'; 

根据你的文件夹结构,rails会抛出一个错误,如果它找不到任何文件,因为rails是不是拿起scss文件。

Depending on your folder structure else rails will throw an error if it can't find any files because rails is not picking up the scss files.

也可以删除所有资源管道材料,并执行@import'font-awesome';

Also you could remove all the asset pipeline stuff and do @import 'font-awesome';

这篇关于我的整个rails应用程序只是从一个文件css为什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆