473,385 Members | 1,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

[XHTML+XML] html and body size

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
Dec 10 '05 #1
5 2999
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
Dec 12 '05 #2
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

Dec 12 '05 #3
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%; }
Dec 12 '05 #4
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.
Dec 16 '05 #5
bipède wrote:
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.

It was simple but it seems that no one have found it until now (nothing
on internet about it).


Hardly, it's documented in the CSS specification.

"The background of the root element becomes the background of the
canvas and covers the entire canvas, anchored at the same point as it
would be if it was painted only for the root element itself. The root
element does not paint this background again.

For HTML documents, however, we recommend that authors specify the
background for the BODY element rather than the HTML element. For HTML
documents whose root HTML element has computed values of 'transparent'
for 'background-color' and 'none' for 'background-image', user agents
must instead use the computed value of those properties from that HTML
element's first BODY element child when painting backgrounds for the
canvas, and must not paint a background for that BODY element. This
does not apply to XHTML documents."
- http://www.w3.org/TR/CSS21/colors.html#q2

I think the replies to your post focussed on the height: 100% issue
rather than the background issue because that seemed to be what you
were asking about.

Steve

Dec 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: John Bokma | last post by:
Hi, I converted most (not all) of my pages at http://johnbokma.com/ to XHTML. I thought this was just a small change from 4.01. However someone stated quite vaguely that my pages are *not*...
10
by: Ian Rastall | last post by:
I get the feeling this was just discussed, so sorry if this is redundant. I want to make my books site XHTML Basic, so it will look good on PDA's. Not knowing what to do, I simply switched...
47
by: Chuck | last post by:
Is there any logical reason why one should convert if css is already being used? What possible, immediate, benefit would there be? I am at a loss to see what, pragmatic, difference it would make.
23
by: Gustaf | last post by:
I just read this article from today: http://webstandards.org/buzz/archive/2005_09.html I need some help understanding this sentense: The W3C recommends XHTML 1.1 should be served with the...
5
by: bipède | last post by:
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...
13
by: Peter Williams | last post by:
Hello, If my html is valid XHTML accroding to http://validator.w3.org/, does thuis mean it is also valid (4.0.1) Html? Thanks in Advance
6
by: Andreas Prilop | last post by:
It seems that Google is unable to "recognize" application/xhtml+xml: http://google.com/search?q=www.unics.uni-hannover.de/nhtcapri/ruby-annotation.x.html "File Format: Unrecognized" Then...
21
by: Russell Hoover | last post by:
I want to make sure that no border (around a specific small "blog-button" image) ever appears in FF or IE, or any other browswer. I couldn't seem do it with xhtml, so I reverted to border="0" ...
21
by: =?iso-8859-2?Q?K=F8i=B9tof_=AEelechovski?= | last post by:
It is common knowledge that XHTML is better HTML and you can serve XHTML content as HTML. However, the second statement is incorrect, for various reasons; it is enough to say that the HTML...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.