简体   繁体   English

Rails资产管道:无效的CSS

[英]rails asset pipeline: Invalid CSS

I am trying to use http://designshack.net/articles/css/build-an-animated-photo-wall-with-css/ to implement a photo wall in my rails app. 我正在尝试使用http://designshack.net/articles/css/build-an-animated-photo-wall-with-css/在Rails应用程序中实现照片墙。 I plugged the CSS for list, paragraph and image, with the only changes in image height and width into my custom.css.scss like so: 我将列表,段落和图像的CSS插入,只有图像高度和宽度的更改才插入我的custom.css.scss中,如下所示:

/* picture wall */

/*------CONTAINER------*/
.container {
  width: 320px;
  margin: 0 auto 50px auto;
}

/*------LIST------*/
.container ul {
  list-style-type: none;
}
 
.container li {
  float: left;
  position: relative;
  width: 280px;
  height: 187px;
  overflow: hidden;
}
 
.container li:hover {
  cursor: pointer;
}

/*------PARAGRAPH------*/
.container li p {
  color: transparent;
  background: transparent;
  font: 200 10px/80px 'Arvo', Helvetica, Arial, sans-serif;
  text-align: center;
  text-transform: uppercase;
   
  position: absolute;
  top: 0;
  left: 0;
  width: 80px;
  height: 80px; 
 
 
  -webkit-transition: all 1s ease;
  -moz-transition: all 1s ease;
  -o-transition: all 1s ease;
  -ms-transition: all 1s ease;
  transition: all 1s ease;
}
 
.container li:hover p {
  color: white;
  background: #000; /*fallback for old browsers*/
  background: rgba(0,0,0,0.7);
}

/*------IMAGES------*/
.container img {
  width: 80px;
  height: 80px;
   
  -webkit-transition: all 1s ease;
  -moz-transition: all 1s ease;
  -o-transition: all 1s ease;
  -ms-transition: all 1s ease;
  transition: all 1s ease;
}
 
.container li:hover img {
  width: 100px;
  height: 100px;
}

The asset pipeline throws the following error in that file: 资产管道在该文件中引发以下错误:

Invalid CSS after "  position:": expected pseudoclass or pseudoelement, was " absolute;"

Commenting out the position line brings up the next line in the file: 注释掉位置行会弹出文件中的下一行:

Invalid CSS after "  top:": expected pseudoclass or pseudoelement, was " 0;"

A syntax problem? 语法问题? Can I not simply put valid css into an scss file? 我不能简单地将有效的CSS放入一个CSS文件中吗? What gives? 是什么赋予了?

Try removing whitespaces below the line with text-transform: uppercase; 尝试使用text-transform: uppercase;删除行下方的空格text-transform: uppercase; .

The problem is in the blank lines! 问题出在空白行! Removed and it does not throw an error. 已删除,它不会引发错误。 Jeez, blank lines are invalid CSS or SASS??? 哎呀,空白行是无效的CSS或SASS ???

(The code still doesn't do what it should, but that is an entirely different issue :-) (代码仍然没有执行应做的事情,但这是一个完全不同的问题:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM