tags:

views:

32

answers:

2

Hi guys !

I gotta admit that's a first-timer bug for me. I've never seen that...

I have this code :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $lang; ?>" >
<head>
    <title><?php echo PAGE_TITLE; ?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <link rel="stylesheet" media="all" type="text/css" title="General" href="./res/css/general.css" />
    <link rel="stylesheet" media="all" type="text/css" title="Popup" href="./res/css/popup.css" />
    <link rel="stylesheet" media="all" type="text/css" title="test" href="./res/css/test.css" />

</head>
<body>
    Hello !
    ...
    absolutely no problem here !!!
    ...
</body>
<html>

I believe nothing's wrong with it, only there must be. When I test the page, all the HTML shows up, but without the appropriate style. In fact, only the first stylesheet has any effet on the style. I tried putting the first file code (working) in one of the other files, and it doesn't work anymore.

I tried googling, but couldn't find anything (maybe I didn't search well too)... I also tried different paths, but it works on the first one, why not the others. I tried renaming the files. I also created the 3rd one especially for that, hoping I just had the name wrong.

It has obsessed me for the last hour... So, I believe I could use some help...

Thanks in advance !
Regards from France ;)

+1  A: 

OK, I got it !!! I don't know why, but title attributes were the thing that blowed the entire thing over. Don't ask me why I have absolutely no idea...

Squ36
Ahh, of course! Didn't think of that. See http://stackoverflow.com/questions/1959959/why-does-the-link-title-attribute-cause-browsers-to-ignore-my-styles for an explanation why.
Pekka
Hoooooooooooo !!!! Now I get it :p Thanks for the link !
Squ36
+1  A: 

If you link to an external style sheet and set a title for it, you specify it as a preferred style sheet:

To make a style sheet preferred, set the rel attribute to "stylesheet" and name the style sheet with the title attribute.

But only the first preferred style sheet is used:

If two or more LINK elements specify a preferred style sheet, the first one takes precedence.

Gumbo