UI Deploy

Curated, Short, Web UI Dev we Love.

CSS Snippet Tutorial - Importing Style Sheets

Cascading Style Sheets, when used properly, do a great job of tidying up messy HTML. But, have you ever felt like your CSS need some refactorization of its own? And sometimes, as part of that refactoring, it would be nice to split your CSS into multiple files - but now you're thinking to yourself, "Well, that's no good, now I'll have some CSS files that depend on others and I will need to remember what needs what when I'm writing new html pages." Fortunately, the designers of CSS felt your pain, and so added the @import rule into CSS2.

The @import statement does almost exactly what you might expect. It causes whatever CSS file is referred to in the @import statement to be used in the determination of the final styles that will be applied to the elements in the html document. The CSS file being referred to can be any url path - it can even refer to a CSS file on a completely different domain!

view post...

Advertisement