View Full Version : Stylesheets with <meta> or @import ?
09-21-2004, 04:52 PM
Hello all :)
I was looking through some html today, and ran into
<style type="text/css" media="all">@import "/styles.css";</style>
which got me thinking... I myself always use
<link rel="stylesheet" type="text/css" href="comic.css" />
Which of these is preferable to use, and why?
09-21-2004, 07:19 PM
simplebits css (http://www.simplebits.com/css/styles.css)
simplebits home (http://www.simplebits.com) (look at his home page code, you can link alternate styles as well)
And here's a bit about import options and what browsers read what:
This is my take on it, some other users will have some better ideas:)
09-21-2004, 08:22 PM
I'll stick to the link method for now.. Looks better :D
09-21-2004, 11:48 PM
but most importantly, importing hides styles from older browsers -- the link tag does not.
The link stylesheet won't be used by NN4.7 unless the media attribute is set as "all". Since there is almost never a reason to use media="all" it's quite simple to hide it from nn4.7.
Designing for the screen? use media="screen, projection" (projection is for Opera's full screen mode - thanks brothercake ;))
Designing for print? use media="print"
... there would be very few cases when you would want the same CSS file used for all these media.
09-22-2004, 01:05 AM
I'd use <link media="all" /> for my styles that are renderable by even the baddest of browsers, and then @import "style.css" for my styles that are meant for more capable browsers (IE5+, Moz)
09-23-2004, 08:25 AM
but who care for NN4.7 ????
09-23-2004, 06:35 PM
but who care for NN4.7 ???? I don't, I don't even code for it anymore -- but sometimes I just like to hide it from older browsers so they just get a simple text version, that's all. I see NN4 just like a screenreader or a handheld -- they get all my information, it just isn't styled like the advanced browsers.
09-24-2004, 03:00 AM
I see NN4 just like a screenreader or a handheld -- they get all my information, it just isn't styled like the advanced browsers.
I'd like to do the same for IE/mac, it's just too much of a pain to filter it properly :mad:
09-24-2004, 03:35 AM
@import "style.css" hides from IE/Mac 4.01 or something like that, according to that link Brady posted. I've not had any problems on IE5 for the Mac... It's better than the Windows version is it not?
09-24-2004, 04:01 AM
@import "style.css" hides from IE/Mac 4.01
ie4?! Who cares about ie4?? :eek:
It's better than the Windows version is it not?
You've got me there - the rendering engine (trident?) was the top of it's time... I'm biased against it though - I've never had enough time to test bugs properly on it and the fact that it has a very different bug set than the windows version makes me want to put it in the NN4.7 bin. Brady insisting that no one uses it anymore isn't tempting me to stop ignoring it either :o
09-24-2004, 04:23 AM
The rendering engine is called Tasman.
09-24-2004, 04:51 AM
Brady insisting that no one uses it anymore isn't tempting me to stop ignoring it either :o
You're only hurting yourself, just let it go...
09-24-2004, 10:01 AM
You might as well use Lynx ;)
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.