Skip to content

Error: Invalid CSS after #2376

@chenxiaochun

Description

@chenxiaochun

code demo

.test {
	background :url(//img12.360buyimg.com/da/jfs/t1708/343/1355811714/2006/812516d1/55e511a9N42e564c7.jpg) no-repeat left center;
	.a{
		width: 235px;
		height: 100px;
	}
}

When i write css code like above, it will be throw exception:

[11:14:16] ERROR Error: Invalid CSS after "	.a": expected ")", was "{"
        on line 3 of css/popupNotice.scss
>> 	.a{
   -^

But, if i write one of the following is ok.
1、 add http protocol

.test {
	background :url(http://img12.360buyimg.com/da/jfs/t1708/343/1355811714/2006/812516d1/55e511a9N42e564c7.jpg) no-repeat left center;
	.a{
		width: 235px;
		height: 100px;
	}
}

2、add another css selector below of the background

.test {
	background :url(http://img12.360buyimg.com/da/jfs/t1708/343/1355811714/2006/812516d1/55e511a9N42e564c7.jpg) no-repeat left center;
	width: 200px;
	.a{
		width: 235px;
		height: 100px;
	}
}

3、wrap the whole http inside

.test {
	background :url("//img12.360buyimg.com/da/jfs/t1708/343/1355811714/2006/812516d1/55e511a9N42e564c7.jpg") no-repeat left center;
	.a{
		width: 235px;
		height: 100px;
	}
}

information

  • NPM version (npm -v):
v4.1.2
  • Node version (node -v):
v4.4.5
  • Node Process (node -p process.versions):
{ 
  http_parser: '2.5.2',
  node: '4.4.5',
  v8: '4.5.103.35',
  uv: '1.8.0',
  zlib: '1.2.8',
  ares: '1.10.1-DEV',
  icu: '56.1',
  modules: '46',
  openssl: '1.0.2h' 
}
  • Node Platform (node -p process.platform):
darwin
  • Node architecture (node -p process.arch):
x64
  • node-sass version (node -p "require('node-sass').info"):
node-sass	3.13.1	(Wrapper)	[JavaScript]
libsass  	3.3.6	(Sass Compiler)	[C/C++]
  • npm node-sass versions (npm ls node-sass):
[email protected] /Users/chenxiaochun/Documents/MyProject/jdf
└── [email protected]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions