Forum Moderators: open

Message Too Old, No Replies

Doctypes depend on server?

         

rfontaine

3:11 pm on Nov 23, 2004 (gmt 0)

10+ Year Member



Hi,

Can server settings have an effect on doctype declarations?

I have been having a problem with doctypes and stylesheet rendering. One one server this doctype causes the stylesheet to work, but on the other other server using the same exact files the stylesheet is ingnored on firefox:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

However the stylesheet on either server works if I use this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

The files all validate in html and css.
<SNIP>

Whats up?

[edited by: BlobFisk at 4:13 pm (utc) on Nov. 23, 2004]
[edit reason] No URLs please! See TOS [webmasterworld.com] [/edit]

encyclo

3:21 pm on Nov 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your problem is almost certainly a server misconfiguration for your CSS file. Files with the extension .css should be sent by the server with the mime type
text/css
. Certain badly-configured servers send out the mime-type
text/plain
or even worse
application/x-pointplus
. When in "quirks mode", Mozilla/Firefox tries to use and render the stylesheet anyway, but in strict mode, the stylesheet is (correctly) ignored.

Assuming you're running Apache, you can put the following in a .htaccess file (or the httpd.conf file if you have root access):

AddType text/css .css

The real solution if you don't have root acess to the server is to get the sysadmin to set up his server correctly by setting the above in the httpd.conf file and restarting Apache.