MIME type application/xhtml+xml... CSS disintergrates... The Tree needed

liunx

Guest
Hi! I am trying to provide a 'application/xhtml+xml' mime type header for browsers like firefox that understand this but when I do this the CSS disintergrates. I have validated the pages with both 'text/html' and 'application/xhtml+xml' and both ways it validates ok.

Here is the page using a text/html (<!-- m --><a class="postlink" href="http://bokehman.com/dns_test.php">http://bokehman.com/dns_test.php</a><!-- m -->) mime type and here is the same page using application/xhtml+xml (<!-- m --><a class="postlink" href="http://bokehman.com/dns_test.php?xml">http://bokehman.com/dns_test.php?xml</a><!-- m -->) (don't bother looking with IE because I am only sending 'text/html' to that browser.

Can anyone tell me where my CSS is faulty?actually I think I might have fixed it by changing:

body {
margin: 0px;
font-size: 10pt;
font-family: verdana, sans-serif;
color: #000;
background:#fff;
background-image: url(blue.gif);
background-repeat: repeat-y;
min-height: 100%;
position: relative;
}


to

html {
margin: 0px;
font-size: 10pt;
font-family: verdana, sans-serif;
color: #000;
background:#fff;
background-image: url(blue.gif);
background-repeat: repeat-y;
min-height: 100%;
position: relative;
}


Why should this be the case. It's as if the body tag is the root element in HTML but the <html> tags are the containing element with an xhtml mime type.you could do

html, body {
margin: 0px;
font-size: 10pt;
font-family: verdana, sans-serif;
color: #000;
background:#fff;
background-image: url(blue.gif);
background-repeat: repeat-y;
min-height: 100%;
position: relative;
}What is that actually going to do? What's the difference between just 'html' or 'html,body'? It seems to display the same.Also Opera sends 'HTTP_ACCEPT: application/xhtml+xml' but fails to display any CSS when the page is sent with that mime type. Any ideas why?well for FF it probably doesn't make a difference but if I am not mistaken (someone please correct me if I'm wrong) IE has a sort of 'outer wrapper' which is html then it has the body. So what you do is use html, body and it corrects for IE's interprertation of the heirarchy. Although while typing this I am thinking that is backwards. Sheesh I wish I could remember. I have been doing the html, body {} thing for so long I forget argggghhh lemme look it up...


::Edit:: AH HAH I did in fact have it backwards... this explains it more or less. Even though it is talking about 100% height for div's it applies because of the parent - child relationship that FF and Netscape have with html and body

<!-- m --><a class="postlink" href="http://www.quirksmode.org/css/100percheight.html">http://www.quirksmode.org/css/100percheight.html</a><!-- m -->

oh and I always give that element margin: 0;

so my first CSS declaration is like this in all my CSS docs

html, body {
margin: 0;
}


Then when you need something 100% in height you do...

html, body {
margin: 0;
height: 100%;
}Have you got Opera? If so have a look with that. Why does it doo that?WTF??? :confused:

Holy cow!?!?!


Hmmm that is weird man! Honestly I have no clue... doesn't mean I don't aim to find out though!

::Edit:: Wait now it is working fine for me.. now I am even more :confused:

::Edit2:: Ok now this is weird... If I enter the address into the address bar it displays opera1.gif (ss attached)
and if I close the browser and open it again it automatically go to the page and displays opera2.gif (which is how it is supposed to look) :confused:

I wonder if it is that CDATA decleration you have in there messing it up?According to the specs (<!-- m --><a class="postlink" href="http://www.w3.org/TR/2002/NOTE-xhtml-media-types-20020801/#summary">http://www.w3.org/TR/2002/NOTE-xhtml-me ... 1/#summary</a><!-- m -->) xhtml 1.0 'should' be served with 'application/xhtml+xml' mime type. It would seem though that browsers that identify themselves as Mozilla/4 can't understand that mime type even though they might claim otherwise. I have just visited a site (<!-- m --><a class="postlink" href="http://golem.ph.utexas.edu/~distler/blog/index.shtml">http://golem.ph.utexas.edu/~distler/blog/index.shtml</a><!-- m -->) (which just out of interest belongs to a theoretical physicist specializing in string theory and quantum field theory). Anyway this site uses MathsML2.0 and serves application/xhtml+xml to FireFox 1.04 and Netscape 7.2 but not to Opera.Edit: It can't be the cdata messing it up because it works fine when I send 'text/html'. Notice the difference in the query string. The one with xml on the end of the querystring will send 'application/xhtml+xml' to any browser that say it will accept it. But when you leave it off you are back to 'text/html'.True... man you have got me stumped!

Anyone else wanna take a shot at what might be going on???
 
Back
Top