if you use in html :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
@import url("css1.css");
</style>
</head>
<body>
<script>
document.querySelector('body').setAttribute('background','red');
</script>
</body>
</html>
or in other css file
//css2.css
@import "css1.css";
//css1.css
body{
background: green;
}
Note:
.1 In some case , @import is the same to link , but @import will load after the document render , so maybe short white time , when use @import .
.2 Use @import can make css module , but use @import “css1.css” in css2.css will cause two http request :
.3 when you use @import xx.css in sass file you after compile will get same file like @import url(‘xx.css’) but compile the css code to the file that use import.