Html CSS在rails应用程序中无法正常工作

Html CSS在rails应用程序中无法正常工作,html,css,ruby-on-rails,sass,Html,Css,Ruby On Rails,Sass,我是rails和编程新手,我用两种不同的控制器、产品和事件构建了一个rails应用程序 我为两个控制器添加了不同的css文件,但我的整个应用程序只是从product.css文件中获取css 我的应用程序.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

我是rails和编程新手,我用两种不同的控制器、产品和事件构建了一个rails应用程序

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

我的应用程序.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;
}
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 ;
}

**
.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%;
}
我的产品。css

/*
 * 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;
}
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 ;
}

**
.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%;
}
event.css

/*
 * 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;
}
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 ;
}

**
.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%;
}

您已经将product.css文件导入到application.css.scss

@import "products"
@import "event"
将以下代码行添加到application.css.scss

@import "products"
@import "event"

不,先生,它不起作用你想从哪些css文件中添加css?我已经用event.css文件@Ganesh kunwar编辑了这个问题看到我的更新答案,它可能会起作用。不,它不@Ganesh KunwarDo不重新发布问题。