View Full Version : Two CSS

Dec 14th, 2006, 12:32 PM
Hey again, I'm just curious how I'd link to two css sheets in one html file.
Like this:

<link rel="stylesheet" type="text/css" href="style.css" />

That's to get my basic design and all the features. But I want to link to the css of the forum I have as well, but I don't know how I'd link to both. They're both in different directories as well.

Thanks guys. =]

Dec 14th, 2006, 02:26 PM
I think this counts as a simple question:)
Well anyway its easy, just insert one more link tag

<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="someDir/anotherstyle.css" />
The sequence matters, though. The above is equivalent to merging the two stylesheets into one .css file in that sequence.

Dec 14th, 2006, 08:08 PM
As long as you don't give the stylesheets a title browsers will pick up all of the stylesheets listed. If you give them titles then only the last one will be used and yourvisitors would need to use a style switcher (either built into their browser or written in Javascript) to switch between them.

If you want to use multiple stylesheets and titles at the same time then use an @import line to import the first stylesheet into the top of the second and just include the second one in the HTML.