CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 11th, 2004, 11:28 AM
Lionheart Lionheart is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Groningen, NL
Posts: 42 Lionheart User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 28 sec
Reputation Power: 8
Question Css ignored in Mozilla and Firebird

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)

Reply With Quote
  #2  
Old June 11th, 2004, 01:27 PM
Kick The Donkey's Avatar
Kick The Donkey Kick The Donkey is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Georgia
Posts: 24 Kick The Donkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 19 sec
Reputation Power: 0
Send a message via MSN to Kick The Donkey
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.

Reply With Quote
  #3  
Old June 12th, 2004, 10:47 AM
Lionheart Lionheart is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Groningen, NL
Posts: 42 Lionheart User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 28 sec
Reputation Power: 8
ok, works for now. thanks anyway

Reply With Quote
  #4  
Old June 14th, 2004, 02:03 PM
1beb's Avatar
1beb 1beb is offline
This tagline is not long enoug
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2003
Location: Toronto, ON Canada! I AM CANADIAN
Posts: 861 1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 h 32 m 12 sec
Reputation Power: 10
Send a message via ICQ to 1beb Send a message via AIM to 1beb Send a message via MSN to 1beb Send a message via Yahoo to 1beb
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)

Reply With Quote
  #5  
Old June 14th, 2004, 02:11 PM
Lionheart Lionheart is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Groningen, NL
Posts: 42 Lionheart User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 28 sec
Reputation Power: 8
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

Reply With Quote
  #6  
Old June 14th, 2004, 02:24 PM
1beb's Avatar
1beb 1beb is offline
This tagline is not long enoug
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2003
Location: Toronto, ON Canada! I AM CANADIAN
Posts: 861 1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 h 32 m 12 sec
Reputation Power: 10
Send a message via ICQ to 1beb Send a message via AIM to 1beb Send a message via MSN to 1beb Send a message via Yahoo to 1beb
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.

Reply With Quote
  #7  
Old June 17th, 2004, 11:20 AM
toofan toofan is offline
:: cerebralshock ::
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: Everywhere & nowhere.
Posts: 133 toofan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 39 m 19 sec
Reputation Power: 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 ::

Reply With Quote
  #8  
Old June 17th, 2004, 02:00 PM
kk5st's Avatar
kk5st kk5st is offline
Thanks Johnny Hart (BC) R.I.P.
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: May 2003
Location: Dallas
Posts: 4,674 kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 15 h 15 m 50 sec
Reputation Power: 687
Quote:
Each css-file starts with the following line:
Code:

<?php Header ("Content-type: text/css");?>

Remove that line.

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.

Reply With Quote
  #9  
Old June 17th, 2004, 03:20 PM
1beb's Avatar
1beb 1beb is offline
This tagline is not long enoug
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2003
Location: Toronto, ON Canada! I AM CANADIAN
Posts: 861 1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 h 32 m 12 sec
Reputation Power: 10
Send a message via ICQ to 1beb Send a message via AIM to 1beb Send a message via MSN to 1beb Send a message via Yahoo to 1beb
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>

Reply With Quote
  #10  
Old June 17th, 2004, 03:53 PM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 2,715 Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 4 Weeks 17 h 42 m 44 sec
Reputation Power: 642
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"); ?>

Reply With Quote
  #11  
Old June 17th, 2004, 03:58 PM
1beb's Avatar
1beb 1beb is offline
This tagline is not long enoug
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2003
Location: Toronto, ON Canada! I AM CANADIAN
Posts: 861 1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level)1beb User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 h 32 m 12 sec
Reputation Power: 10
Send a message via ICQ to 1beb Send a message via AIM to 1beb Send a message via MSN to 1beb Send a message via Yahoo to 1beb
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 )

Reply With Quote
  #12  
Old June 18th, 2004, 04:09 AM
Lionheart Lionheart is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Groningen, NL
Posts: 42 Lionheart User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 28 sec
Reputation Power: 8
Thumbs up

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:
My solution was to remove the "/" at the beginning of the link path.

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:
Remove the line
<?php Header ("Content-type: text/css");?>
...because it throws IE into quirks mode. That leads to unexpected results.

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?

Reply With Quote
  #13  
Old June 18th, 2004, 04:55 AM
kk5st's Avatar
kk5st kk5st is offline
Thanks Johnny Hart (BC) R.I.P.
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: May 2003
Location: Dallas
Posts: 4,674 kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level)kk5st User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 3 Days 15 h 15 m 50 sec
Reputation Power: 687
Quote:
Quote:
Remove the line
<?php Header ("Content-type: text/css");?>
...because it throws IE into quirks mode. That leads to unexpected results.
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?

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

Reply With Quote
  #14  
Old June 18th, 2004, 06:51 AM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 2,715 Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)Akh User rank is Brigadier General (60000 - 70000 Reputation Level)