Can you include more than 1 style sheet on 1 XHTML page?
Printable View
Can you include more than 1 style sheet on 1 XHTML page?
Yes. Simply have more than one <link rel="stylesheet"> element. Or use the @import directive to import more CSS files from within one.
Is there a prefered one? I'm thinking the @import directive might be the best so it cuts down on my HTML.
It doesn't really matter.
-tg
There is a slight difference, <link> tags enable you to create multiple stylesheets that the user can switch between (in browsers that support it), while @import directives cannot be overriden (except by turning styles completely off). So if you want to combine multiple stylesheets have one master stylesheet that you link to and use @import directives in that to include the other stylesheets. If you want to have alternative stylesheets then use the link tag.