Click here to get back home

[XHTML+XML] html and body size

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
[XHTML+XML] html and body size bipède 12-10-2005
Get Chitika Premium
Posted by bipède on December 10, 2005, 11:04 am
Please log in for more thread options


Hi,

Is it possible in Mozilla / Firefox / Netscape to fix minimum size for
html and/or body element in a "real" XHTML (mime application/xhtml+xml)
page so that when there is few text in a page the background color fill
the window and when content exeed the window size the body resize to
include all the content.

For now I can't figure out how to do this, if I use height:100%;
width:100% the size of html and body is *always* 100% even if there is
exeeding content and the background color just stop at 100% of the
window size. In fact the html and body width seems to be always 100%: a
big image exeed the background even if I set width:auto, it's really
disconcerting.

min-width and min-height doesn't seems to be taken into account.

thanks in advance
any solution would be welcome

Posted by Gus Richter on December 11, 2005, 11:10 pm
Please log in for more thread options


bipède wrote:
> Hi,
>
> Is it possible in Mozilla / Firefox / Netscape to fix minimum size for
> html and/or body element in a "real" XHTML (mime application/xhtml+xml)
> page so that when there is few text in a page the background color fill
> the window and when content exeed the window size the body resize to
> include all the content.
>
> For now I can't figure out how to do this, if I use height:100%;
> width:100% the size of html and body is *always* 100% even if there is
> exeeding content and the background color just stop at 100% of the
> window size. In fact the html and body width seems to be always 100%: a
> big image exeed the background even if I set width:auto, it's really
> disconcerting.
>
> min-width and min-height doesn't seems to be taken into account.
>
> thanks in advance
> any solution would be welcome

Have you tried placing everything inside a wrapper div and repeating the
background request in it as well?

--
Gus

Posted by Toby Miller on December 12, 2005, 5:30 am
Please log in for more thread options


It does work in Firefox, but I've been unable to get it to work in
Safari. This is as far as I was able to get:

<style type="text/css">

html,
body {
height:100%;
}
body {
margin:0;
padding:0;
}
div#content {
height:100%;
min-height:100%;
background-color:pink;
}

</style>

Then put your content within:

<div id="content">Your content here</div>

If you come up with the Safari workaround I'd love to see it.

-tm


Posted by Pawel Knapik on December 12, 2005, 7:44 pm
Please log in for more thread options


bipède napisał(a):
> Hi,
>
> Is it possible in Mozilla / Firefox / Netscape to fix minimum size for
> html and/or body element in a "real" XHTML (mime application/xhtml+xml)
> page so that when there is few text in a page the background color fill
> the window and when content exeed the window size the body resize to
> include all the content.
>
> For now I can't figure out how to do this, if I use height:100%;
> width:100% the size of html and body is *always* 100% even if there is
> exeeding content and the background color just stop at 100% of the
> window size. In fact the html and body width seems to be always 100%: a
> big image exeed the background even if I set width:auto, it's really
> disconcerting.
>
> min-width and min-height doesn't seems to be taken into account.

if you use
html, body { height:100%; min-height:100%; }
you will get 100% because you defined it. the above means
"exactly 100% and no less than 100%".

try
html, body { height:auto; min-height:100%; }
and should work.

if you want to support IE (by content negotiation) you can
use a simple "hack":
html, body { height:auto !important; height:100%;
min-height:100%; }

Posted by bipède on December 16, 2005, 11:32 am
Please log in for more thread options


bipède wrote:
> Hi,
>
> Is it possible in Mozilla / Firefox / Netscape to fix minimum size for
> html and/or body element in a "real" XHTML (mime application/xhtml+xml)
> page so that when there is few text in a page the background color fill
> the window and when content exeed the window size the body resize to
> include all the content.
>
> For now I can't figure out how to do this, if I use height:100%;
> width:100% the size of html and body is *always* 100% even if there is
> exeeding content and the background color just stop at 100% of the
> window size. In fact the html and body width seems to be always 100%: a
> big image exeed the background even if I set width:auto, it's really
> disconcerting.
>
> min-width and min-height doesn't seems to be taken into account.
>
> thanks in advance
> any solution would be welcome


Thanks for all your answers,

I have found the work arround, in fact in real XHTML with netscape /
mozilla / firefox if you want to have a background color or a repeated
background image that always fill the window you should set it for
'html' tag and not 'body' tag. Here's the solution I use :

html {
        padding:0;
        margin:0;
        background:#f4f4f4 url('/images/fond-colonne.png') repeat-y left;
}

It was simple but it seems that no one have found it until now (nothing
on internet about it). Other solutions I tried dont work.

Similar ThreadsPosted
set size of body in pixels July 27, 2008, 7:03 pm
How to set default font size to small for a page's body? April 16, 2008, 9:58 am
Re: is invalid html 4 strict? June 21, 2008, 1:43 pm
Re: is invalid html 4 strict? June 21, 2008, 6:15 pm
question about the BODY tag in the HTML DTD April 8, 2008, 3:36 pm
Tradeoffs of setting background-color on html vs. body? August 19, 2008, 12:41 pm
Firefox - Prevent TextField size change when user changes font size? October 3, 2006, 6:21 pm
Set printer paper size from HTML? January 28, 2008, 2:25 pm
How to make font size constant in HTML November 15, 2004, 10:59 pm
BODY DIR=LTR March 7, 2006, 9:01 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap