Reputation: 23
I'm trying to understand what happens when a css file is imported in another css file.
I know how its done but not what exactly is happening when its done.
For example maybe this combines the two css files or is it doing something else?
And what's the difference between importing a css file in html or importing it in css?
i couldn't find the why on google unfortunately can somebody please explain this me or maybe drop a link that explains this?
for example we have a main.css like this:
@import:"secondary.css"
body{ background:blue;}
and then a secondary.css like this:
p{color:red;}
What will happen after the import?
Upvotes: 1
Views: 294
Reputation:
Hi,
The @import
rule allow you to import style rules from other style sheets expect @charset
rule
As you Example the main.css contain rules like this
body{ background:blue;}
p{color:red;}
Upvotes: 2