View Full Version : Second stylesheet not used

07-31-2010, 08:43 AM
I've got a feeling that alcohol may be to blame but can anyone tell me why my second stylesheet doesn't work? The page is generated partly by PHP but if you look at the source for this page (http://www.yourwebskills.com/boxmodel.php) you should see:

<link rel="stylesheet" type="text/css" href="./styles/default.css" title="default" />
<link rel="stylesheet" type="text/css" href="./styles/boxtoy.css" title="boxtoy" />

The intention is that the styles for the "boxtoy" DIV should be in the second sheet but when they go there they are ignored. Using Dragonfly in Opera the sheet seems correctly linked and both HTML and the second stylesheet validate (and the boxtoy styles work fine when I put them in the main stylesheet).

I have temporarily applied just one style in the second sheet to reduce the chances of me messing up in there.

Preparing to look stupid.....

07-31-2010, 09:22 AM
<link rel="stylesheet" type="text/css" href="./styles/boxtoy.css" title="boxtoy" /> Seems like you are not aware of the purpose of title attribute of <link> tag. Read https://developer.mozilla.org/en/Correctly_Using_Titles_With_External_Stylesheets and http://www.alistapart.com/articles/alternate/

07-31-2010, 09:48 AM
You are right - thanks. Never seen that before and was using the titles for another reason.