As others said, this is invalid CSS, but I want to add my 2 cents. If you are looking for a way to overcome this problem and also write better CSS (ie CSS that is more concise, easier to read and to maintain), you can use SASS. It's a program that enhances the CSS syntax and generates valid CSS files ready to be served to browsers. It's installed as a Ruby gem, then you can launch it this way
sass --watch style.scss:style.css
Every time style.scss
is modified, a new style.css
is compiled. scss
is the standard file extensions for SASS source files. In SASS this code is valid
@import "import1.scss";
a {
color: red;
}
@import "import2.scss";
and compiles to the following style.css
a {
/* This is the content of import1.scss */
color: white;
}
a {
color: red;
}
a {
/* This is the content of import2.scss */
color: white;
}
Note that I imported files ending in scss. This is advertised by the SASS reference not to fall back to regular CSS imports.