tags:

views:

84

answers:

4

I have a homepage.html and it refers to styles.css(makes a table). But I also want homepage.html to refer to styles12.css because in styles12.css I have the css for taps.

how would I refer to two .css files?

<title>Testing Css/HTML files</title>
<link rel="stylesheet" type="text/css" href="style.css" />

Can I just make another <link rel="stylesheet" type="text/css" href="style12.css" />?

+4  A: 

Yes (you could have tried that ;-)

ChristopheD
A: 

Yes. Just use multiple link elements.

Note, however, that it isn't very efficient and it is generally better to combine all your stylesheets into a single file.

David Dorward
Do you have references for this?
Renesis
http://developer.yahoo.com/performance/rules.html / http://code.google.com/speed/page-speed/docs/rtt.html#CombineExternalCSS
David Dorward
The server is having to stat, open, and transmit multiple files. There's a little bit of overhead in doing this. Browsers use keep-alive connections now so multiple files are sent over one network connection. Originally HTTP requests only fetched one file, so you had the overhead of establishing a connection for each file. In the days of HTTP 1.0 multiple files incurred large (by comparison) overhead. HTTP 1.1 and keep-alive greatly reduced it, but not completely.
Erik Nedwidek
A: 

Yes, and the order of precedence for rules will follow the basic CSS precedence ruleset, and later rules overwrite earlier rules if they specify the same attributes.

You might want to read this article on specificity.

Stefan Kendall
+1  A: 

you can also use @import inside other style sheets.

@import url("site.css");
Hugh
+1 I generally prefer this method. (There are, of course, exceptions.)
Michael Itzoe
I wouldn't recommended @import. 1.) older browsers don't understand it, 2.) @import rules can cause resources to not get downloaded in the order specified in IE (where you have 3 or more) (note IE has a built in limit of 31 (either way))
scunliffe