On Wed, 5 Jan 2005 13:34:10 -0000, James Smith <[EMAIL PROTECTED]> wrote: > What is the essential diference between the following two methods of using > style sheets and is either one more correct than the other.
Similarities: - Both reference external stylesheets - Both can be used multiple times to call multiple stylesheets - Both can designate what media they are to be used with (Screen, print, etc.) Differences: - @import can only be used inside <style> tags. - The @import rule must be placed before any other rules. (Be careful: IE doesn't follow this rule so if you develop in IE it's easy to get confused when a compliant browser doesn't show styles.) - @import can be used in external stylesheets (Really cool! Think "extends".) - @import is ignored by NS4 Neither is better than the other, per se. They do basically the same thing, but the differences allow you to do some nifty things. For instance, consider the fact that NS4 ignores the @import. This may sound bad, but it can really be a blessing when you consider how crappy NS4 is at CSS anyway. NS4 can handle basic font styling with CSS but really freaks out on pretty much anything else. So you could @import a stylesheet that contains your site layout, but leaves out the type styles, and then <link> to a basic stylesheet that contains the minor font styling and such, and NS will show the minor styling but ignore the layout which it would munge anyway. It forces NS4 to degrade gracefully like it should. It won't look good, but at least it will be readable content instead of a total mess. -Kevin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:5:141563 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/5 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:5 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
