|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I have a problem. The page with css is loaded as I would expect in MSIE. However in Mozilla 1.6 and Firebird, the css is ignored. Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="nl-nl" lang="nl-nl">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link rel="stylesheet" type="text/css" href="/css/preek.css" />
<title>God is tegenwoordig</title>
The page will only load in Mozilla and Firebird as expected when I leave out the lines: Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Changing towards another doctypes does not change a bit. The css-file is served as text/css - so that's fine. Further, the html is validated and ok, same goes for the css. Sitting with my head in my hands... Hope you can help me, because page looks like the old days (mosaic) |
|
#2
|
||||
|
||||
|
Change this:
Code:
<link rel="stylesheet" type="text/css" href="/css/preek.css" /> To be this: Code:
<link rel="stylesheet" type="text/css" href="./css/preek.css" /> Hope that helps. |
|
#3
|
|||
|
|||
|
ok, works for now. thanks anyway
|
|
#4
|
||||
|
||||
|
Most apache servers will freak out with that Document Type Definition (DTD)... You should remove this line
Code:
<?xml version="1.0" encoding="utf-8"?> If you want a good explanation of why you should use caution with xhtml DTD's, Akh graciously provided this link (http://www.hixie.ch/advocacy/xhtml) to me in this thread (http://forums.devshed.com/t101643/s.html)
__________________
The Standards! CSS 2 - CSS 3 - w3c CSS Validator - XHTML 1.1 - HTML 4.01 - w3c (X)HTML Validator - ActionScript Reference Links! Bert's Door and Lock Service | Brandon Erik Bertelsen | TextPattern |
|
#5
|
|||
|
|||
|
How it works for me
Each css-file starts with the following line:
Code:
<?php Header ("Content-type: text/css");?>
The .htaccess file in the root contains the lines: Code:
AddType application/x-httpd-php .css AddHandler application/x-httpd-php .php .html You could also probably move the line (AddType application/x-httpd-php .css) to a .htaccess file in the css directory. Richard |
|
#6
|
||||
|
||||
|
That's not a very good idea at all, every single html page is now going to be processed as php.
Well at least in the directory that you put that .htaccess file in Last edited by 1beb : June 14th, 2004 at 02:27 PM. |
|
#7
|
|||
|
|||
|
I was having exactly the same problem, but adding the "." to the beginning of the link path didn't make a difference. Javascript is sometimes affected by this in IE too.
My solution was to remove the "/" at the beginning of the link path. The weird thing is that the former works in local testing, but not when I uploaded to my web server.
__________________
:: a short sharp shock up the nervous system :: |
|
#8
|
||||
|
||||
|
Quote:
As to the xml prolog <?xml…, you should remove it—not because of Apache, but because it throws IE into quirks mode. That leads to unexpected results. cheers. gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing. My html and css workshop, demos and tutorials. Ask a better question, get a better answer. |
|
#9
|
||||
|
||||
|
Oh I assure you it breaks apache... I'm not sure of the exact reason why, although I would suspect that after declaring xml, it is expecting to see a page formatted in xml...
For example, www.bertelsen.ca/test2/ Code:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>BLEH</title> </head> <body> <p>Hello</p> </body> </html> |
|
#10
|
||||
|
||||
|
have you set html to be parsed as php?
this could make it interpreter the <?xml ...?> as php. you can use this line to avoid this. <?php echo("<?xml version='1.0' encoding='UTF-8'?>\n"); ?> |
|
#11
|
||||
|
||||
|
That makes sense... the <? is like calling php, and then you are supplying it something other than php... it tells you that it hates you.
On the ball Akh. (Gary, you need to stop writing Cheers at the end of your post, I've been reading so many of your posts that I've actually started SAYING cheers... grrr ) |
|
#12
|
||||
|
||||
|
Yes, I parse my html pages in a particular directory using php.
and as you can see: my css files as well. I indeed use the line: echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; Quote:
I think a starting './' or '/' (both refering to the root) are the same on unix. And I suspect './' does not work on windows. A path without starting slash refers to a subdir, which could be one in the root or elsewhere, depending which html-file is loaded. Quote:
I cannot remove it, otherwise the css file is loaded as text/html. Mozilla Navigator needs "text/css" to be able to use the css file. I can see that Mozilla Navigator uses Standards compliance mode. Is that OK? How can I see how IE renders it? What are unexpected results? |
|
#13
|
||||
|
||||
|
Quote:
The xml prolog, "<?xml version="1.0" encoding="utf-8"?>" should be removed because it throws IE into quirks mode (just one more IE bug). That means that IE6 emulates earlier even poorer complying versions. "AddType application/x-httpd-php .css" causes the css files to be preprocessed as PHP and delivered as text/html rather than text/css. This is wrong. If you want to have css rules dynamically formed, they should be embedded rather than external. The external files are called and cached locally and must be of type text/css. So remove that AddType from your .htaccess file and remove the header line from the css file. cheers, gary |
|
#14
|
||||
|