Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 11:45 PM
Neal
Guest
 
Posts: n/a
Default Body shorter in Mozilla when XML

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.
  #2  
Old July 20th, 2005, 11:45 PM
Johannes Koch
Guest
 
Posts: n/a
Default Re: Body shorter in Mozilla when XML

Neal wrote:[color=blue]
> 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.[/color]

<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.)
  #3  
Old July 20th, 2005, 11:45 PM
Mark Tranchant
Guest
 
Posts: n/a
Default Re: Body shorter in Mozilla when XML

Neal wrote:
[color=blue]
> 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.[/color]

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

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

--
Mark.
  #4  
Old July 20th, 2005, 11:45 PM
Neal
Guest
 
Posts: n/a
Default Re: Body shorter in Mozilla when XML

On Tue, 25 May 2004 14:20:11 +0100, Mark Tranchant
<mark@tranchant.plus.com> wrote:
[color=blue]
> Neal wrote:
>[color=green]
>> 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.[/color]
>
> Apply the background colour to the html element in your style sheet.[/color]

Fixed. Very odd this only happens when served as XHTML...
[color=blue]
> Oh, and see http://tranchant.plus.com/notes/multiviews[/color]

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.

  #5  
Old July 20th, 2005, 11:45 PM
Mark Tranchant
Guest
 
Posts: n/a
Default Re: Body shorter in Mozilla when XML

Neal wrote:
[color=blue][color=green]
>> Apply the background colour to the html element in your style sheet.[/color]
>
> Fixed. Very odd this only happens when served as XHTML...[/color]

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; }
[color=blue][color=green]
>> Oh, and see http://tranchant.plus.com/notes/multiviews[/color]
>
> 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.[/color]

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.
  #6  
Old July 20th, 2005, 11:45 PM
Nick Kew
Guest
 
Posts: n/a
Default Re: Body shorter in Mozilla when XML

In article <opr8j42vqo6v6656@news.individual.net>,
Neal <neal413@yahoo.com> writes:
[color=blue]
> Fixed. Very odd this only happens when served as XHTML...[/color]

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/
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles