tags:

views:

32

answers:

2

When I added

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

line to the top of my html file, my css rules disappear in firefox. Also i can't see them with firebug.

Do you have any idea about this problem ?

+1  A: 

You need to add attributes to your start-html tag to get it right. This is done since XHTML really is XML.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <link href="style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    ...
    </body>
</html>

The code above suggest you to have the style.css file in the root-catalog of your website.

BennySkogberg
firefox normally show correctly the css with or without the attributes on html
Sotiris
I think you're right, and you'll end up in quirks mode. There must be another problem with the css. Path? Error in Syntax? One need to see more of the code to know whats wrong here.
BennySkogberg
+3  A: 

Make sure that the files are sent by the server with the correct MIME type (text/css). Have a look in the error console ( IIRC the menu should be Tools / Error Console in the English version).

Usually, if the file ends with .css, this should happen automatically, however there are still badly configured servers around. If you are using a Apache web server, you may be able to correct this with a .htaccess file, otherwise you'll need to ask your support.

Details: https://developer.mozilla.org/en/incorrect_mime_type_for_css_files

RoToRa
"Yes you are right, i looked at the error log : Error: The stylesheet http://...../css/....css was not loaded because its MIME type, "text/html", is not "text/css". Source File: http://...../....html " I will try to fix this problem but I realized that there is also problem in IE. I use two column layout in my design an two div with 100% height. But in IE they don't appear correctly. Line: 0
penguru