Is the only importance of an @import function compared to <link rel="StyleSheet"> is that it does not "save" the CSS stylesheet when we "Save As" a webpage?Code:<style type="text/css"> @import style.css"; </style>
Or is there a different reason?
Is the only importance of an @import function compared to <link rel="StyleSheet"> is that it does not "save" the CSS stylesheet when we "Save As" a webpage?Code:<style type="text/css"> @import style.css"; </style>
Or is there a different reason?
I've never seen that before. Not sure about it, but I'd suggest not using that... use the more usual style, just to ensure compatibility...
That may be fine though.... but since I haven't seen it, I'm just guessing it isn't a standard option... or at least might not be.
As for your question, I would assume so. Also, different browsers would handle the "saving" differently, so keep that in mind too.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
you can import it within a css file.
No, not in the least. They have completely different purposes. The former essentially means that a style sheet requires or uses rules from another style sheet. For example, one might choose to separate rules such that one style sheet contains simple, common rules that apply to all documents in a site, and those style sheets that include it then build upon those rules, refining them for a particular layout. Whilst one could use multiple link elements to do the same thing, there really is no need (and it requires more bytes to do the same job).
If a user agent doesn't save an imported style sheet, that is a peculiarity of that program. All a user agent need do is examine the beginning of a style sheet for any import rules, and add them to its list of resources to save.
It was specified in the first version of CSS and in every version since; it's been supported for years.
Mike
Last edited by mwinter; 11-19-2006 at 02:55 PM.
@import does not support the media type in IE6 directly. But that's no reason not to use it, as you can assign media-type in the style tag.
Bookmarks