By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,624 Members | 2,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,624 IT Pros & Developers. It's quick & easy.

Body shorter in Mozilla when XML

P: n/a
http://www.opro.org/index.php

CSS in question at http://www.opro.org/default.css and
http://www.opro.org/imported.css

This is a PHP experiment served as application/xhtml+xml when possible.
The document is otherwise identical to http://www.opro.org/index.html
which is served as text/html.

Issue: In Mozilla 1.6, on the .php (xml+xhtml) page the body element does
not extend to the bottom of the viewport - note the background color. In
the .html (text/html) version, it does.

Stumped.
Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Neal wrote:
Issue: In Mozilla 1.6, on the .php (xml+xhtml) page the body element
does not extend to the bottom of the viewport - note the background
color. In the .html (text/html) version, it does.

Stumped.


<http://www.w3.org/TR/REC-CSS2/colors.html#q2>:

The background of the box generated by the root element covers the
entire canvas.

For HTML documents, however, we recommend that authors specify the
background for the BODY element rather than the HTML element. User
agents should observe the following precedence rules to fill in the
background: if the value of the 'background' property for the HTML
element is different from 'transparent' then use it, else use the
value of the 'background' property for the BODY element. If the
resulting value is 'transparent', the rendering is undefined.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #2

P: n/a
Neal wrote:
http://www.opro.org/index.php

CSS in question at http://www.opro.org/default.css and
http://www.opro.org/imported.css

This is a PHP experiment served as application/xhtml+xml when possible.
The document is otherwise identical to http://www.opro.org/index.html
which is served as text/html.

Issue: In Mozilla 1.6, on the .php (xml+xhtml) page the body element
does not extend to the bottom of the viewport - note the background
color. In the .html (text/html) version, it does.


Apply the background colour to the html element in your style sheet.

Oh, and see http://tranchant.plus.com/notes/multiviews

--
Mark.
Jul 20 '05 #3

P: n/a
On Tue, 25 May 2004 14:20:11 +0100, Mark Tranchant
<ma**@tranchant.plus.com> wrote:
Neal wrote:
http://www.opro.org/index.php

CSS in question at http://www.opro.org/default.css and
http://www.opro.org/imported.css

This is a PHP experiment served as application/xhtml+xml when possible.
The document is otherwise identical to http://www.opro.org/index.html
which is served as text/html.

Issue: In Mozilla 1.6, on the .php (xml+xhtml) page the body element
does not extend to the bottom of the viewport - note the background
color. In the .html (text/html) version, it does.
Apply the background colour to the html element in your style sheet.


Fixed. Very odd this only happens when served as XHTML...
Oh, and see http://tranchant.plus.com/notes/multiviews


Unfortunately, my host runs PHP 4.0.6... well, this experiment is in an
extremely early stage. Eventually, as I figure PHP out, I'd like the whole
site in PHP.

Jul 20 '05 #4

P: n/a
Neal wrote:
Apply the background colour to the html element in your style sheet.


Fixed. Very odd this only happens when served as XHTML...


It's in the specs, IIRC. You can specify the background for both
elements without problem, and the declaration will give the desired
effect for both types:

html, body { background-color: #123456; }
Oh, and see http://tranchant.plus.com/notes/multiviews


Unfortunately, my host runs PHP 4.0.6... well, this experiment is in an
extremely early stage. Eventually, as I figure PHP out, I'd like the
whole site in PHP.


I suspect that 4.0.6 will exhibit the same characteristics, although you
need to use $HTTP_SERVER_VARS instead of $_SERVER:

http://shorl.com/fenogratregryke

It's about time your host updated PHP, though! 4.0.6 is nearly three
years old.

--
Mark.
Jul 20 '05 #5

P: n/a
In article <op**************@news.individual.net>,
Neal <ne*****@yahoo.com> writes:
Fixed. Very odd this only happens when served as XHTML...


Working hypothesis:

HTML has semantics, which make <body> the root element for the
display. XML has no such semantics. XHTML is parsed as XML.

You're benefitting from the additional semantics available in HTML.
To get it in XML you have to do it yourself, with properties on the
<html> and <body> elements.

--
Nick Kew

Nick's manifesto: http://www.htmlhelp.com/~nick/
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.