|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
@import or <link>? - CSS
I've been looking over CSS tutorials, articles, and other miscellaneous bumf, and I just happened to be wondering...
What is the preferred or correct way to import style sheets: @import or <link>? I know that the @import rule under windows can have a strange side-effect of 'flashing' the unstyled content of the page before reflowing. So why use this, and not <link>? Is this something to do with standards ( not again, that terrible yet wonderous word), or just down to the coding preference of the developer?Comments and thoughts please ppl ![]()
__________________
R.T.F.M - Its the only way to fly... "No matter what you do, or how good it is, someone will always ask for more features. Or to change the colour of something, then change their minds." Personal: experience// 8 Years Web Development technologies// Standards-compliant, valid, & accessible (x)HTML/CSS, XML/XSL/XPath/XQuery/XUpdate, (OOP) PHP/(My)SQL, eXist/Xindice/XMLDBs packages// Photoshop, Illustrator, Flash/Fireworks/Director environment// FC2, MySQL, Lighttpd, PHP5, Mojavi/Agavi site// //refactored.net/ (Coming soon...) quote// Programming is the eternal competition between programmers who try to make apps more and more idiot proof and the universe that makes dumber idiots. So far, the universe is winning... |
|
#2
|
||||
|
||||
|
I'm new to using @import too, but it's my understanding that @import is similar to an `include`. So let's say you default.css which only contains site wide fonts and default colors, then you have more specific stylesheets that would @import this default stylesheet, instead of repeating the style declaration or using multiple <link> statements.
<link> is used within HTML, @import is used within the stylesheet itself. I'm sure someone will correct me if I understood all of this incorrectly.
__________________
# Jeremy Explain your problem instead of asking how to do what you decided was the solution. |
|
#3
|
||||
|
||||
|
i usually use @import
just remember that netscape 4.x don't support @import. but you can use that to an advantage, use a simple style in the link for netscape, and an more advanced style in the @import http://www.dcjt.demon.co.uk/dc/web/2002/hidecss.html just remeber that ie has its problem too http://www.bluerobot.com/web/css/fouc.asp |
|
#4
|
||||
|
||||
|
Thats what i mean, the "flash"ing of content before the style is applied. Surely it would be better to just use <link> to avoid this bug?
|
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > @import or <link>? - CSS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|