我是rails和编程的新手,我已经构建了一个带有两个不同控制器,产品和事件的rails应用程序
我为这两个控制器添加了不同的css文件,但我的整个应用程序只从product.css文件中获取了css。
我的application.css.scss
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*= require font-awesome
*/
@import "bootstrap-sprockets";
@import "bootstrap";
body {
padding-top: 100px;
}
my products.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 ;
}
**
event.css
.section {
clear: both;
padding: 0px;
margin: 0px;
}
.group:before,
.group:after {
content:"";
display:table;
}
.group:after {
clear:both;
}
.group {
zoom:1;
}
.listview_1_of_3{
display: block;
float:left;
margin: 0% 0 0% 1.6%;
}
.listimg{
display: block;
float:left;
}
.text{
display: block;
float:left;
margin: 0% 0 0% 3.6%;
}
答案 0 :(得分:0)
您已将import.css文件导入application.css.scss
将以下代码行添加到application.css.scss
@import "products"
@import "event"