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

Fitting complete browserwindow

P: n/a
Hi,

I have a problem since I use a full DOCTYPE.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body style="height:100%">
<table cellspacing="0" cellpadding="0" border="1" style="width:100%;
height:100%;">
<tr style="height:50px">
<td valign="top">header</td>
</tr>
<tr style="height:100%;">
<td valign="top">body</td>
<tr>
<tr style="height:20px">
<td valign="top">footer</td>
</tr>
</table>
</body>
</html>

This works very well. The whole content fits in the browser window. When I
add the URL to the DOCTYPE:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

it doesn't work anymore with IE6. Since I have to use the latter DOCTYPE I
need a solution that leads to the same result as the first samle.
Can onyone help me with this.

--
bye Stephan...

Jul 20 '05 #1
Share this Question
Share on Google+
22 Replies


P: n/a
Els

Stephan Koser wrote:
Hi,

I have a problem since I use a full DOCTYPE.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body style="height:100%">
<table cellspacing="0" cellpadding="0" border="1" style="width:100%;
height:100%;">
<tr style="height:50px">
<td valign="top">header</td>
</tr>
<tr style="height:100%;">
<td valign="top">body</td>
<tr>
<tr style="height:20px">
<td valign="top">footer</td>
</tr>
</table>
</body>
</html>

This works very well. The whole content fits in the browser window. When I
add the URL to the DOCTYPE:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

it doesn't work anymore with IE6. Since I have to use the latter DOCTYPE I
need a solution that leads to the same result as the first samle.
Can onyone help me with this.


Haven't looked into the 'fits in browserwindow' effect, but
the height on the tr won't work. tr doesn't have height, you
have to set height on the td instead.
--
Els

Mente humana é como pára-quedas; funciona melhor aberta.

Jul 20 '05 #2

P: n/a
*Stephan Koser*:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<body style="height:100%">
<table border="1" style="height:100%;">
<tr style="height:50px">
<tr style="height:100%;">
<tr style="height:20px">

This works very well. The whole content fits in the browser window.
Well, the three words "header", "body", "footer" should fit in virtually any
browser window, but what if there was more content than fits into 'body''s
100% high box?
When I add the URL to the DOCTYPE (...) it doesn't work anymore with IE6.
Nor in any browser which implements the CSS1+2 box model (almost) correctly.
Since I have to use the latter DOCTYPE
Why do you *have to* do that?
I need a solution that leads to the same result as the first samle.


s/tr style="height:100%;"/tr/

--
Useless Fact #10:
Percentage of Americans who have visited Disneyland/Disney World: 70%.
Jul 20 '05 #3

P: n/a
*Els*:

the height on the tr won't work. tr doesn't have height,
From REC-CSS2:

'height'
(...)
Applies to: all elements but non-replaced inline elements,
table columns, and column groups

From HTML 4.01 Loose DTD (comments removed):

<!ATTLIST TR
%attrs;
%cellhalign;
%cellvalign;
bgcolor %Color; #IMPLIED <!ATTLIST (TH|TD)
(...)
width %Length; #IMPLIED
height %Length; #IMPLIED


You are confusing something, I presume. In HTML4 Strict 'th' and 'td' don't
have 'height' and 'width' attributes either.

--
Reality is an illusion that occurs due to the lack of alcohol.
Jul 20 '05 #4

P: n/a
Els
Christoph Paeper wrote:
*Els*:
the height on the tr won't work. tr doesn't have height,


From REC-CSS2:

'height'
(...)
Applies to: all elements but non-replaced inline elements,
table columns, and column groups

From HTML 4.01 Loose DTD (comments removed):

<!ATTLIST TR
%attrs;
%cellhalign;
%cellvalign;
bgcolor %Color; #IMPLIED
>

<!ATTLIST (TH|TD)
(...)
width %Length; #IMPLIED
height %Length; #IMPLIED
>


You are confusing something, I presume. In HTML4 Strict 'th' and 'td' don't
have 'height' and 'width' attributes either.


That's the html.
As Stephan is using <tr style="..">, I am just saying he
should set the height to the td instead. I'll be more exact
this time:
You can set the height to the td instead, as long as you use
css to do it, and not html. But even with css, it won't work
on tr, only on td.

--
Els

Mente humana é como pára-quedas; funciona melhor aberta.

Jul 20 '05 #5

P: n/a
Christoph Paeper <ch**************@nurfuerspam.de> wrote:
*Stephan Koser*:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<body style="height:100%">
<table border="1" style="height:100%;">
<tr style="height:50px">
<tr style="height:100%;">
<tr style="height:20px">

This works very well. The whole content fits in the browser window.


Well, the three words "header", "body", "footer" should fit in virtually any
browser window, but what if there was more content than fits into 'body''s
100% high box?
When I add the URL to the DOCTYPE (...) it doesn't work anymore with IE6.


Nor in any browser which implements the CSS1+2 box model (almost) correctly.
Since I have to use the latter DOCTYPE


Why do you *have to* do that?
I need a solution that leads to the same result as the first samle.


s/tr style="height:100%;"/tr/


In case the OP doesn't happen to know traditional text editor command
syntax, this means to change the string "tr style="height:100%"" to
"tr".

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #6

P: n/a

"Christoph Paeper" <ch**************@nurfuerspam.de> schrieb im Newsbeitrag
news:c1***********@ariadne.rz.tu-clausthal.de...
*Stephan Koser*:

Since I have to use the latter DOCTYPE


Why do you *have to* do that?


In Germay we have legal restraints how a web page has to be implemented to
be barrier free. So the doctype should contain also the URL to the DTD.

--
bye Stephan...
Jul 20 '05 #7

P: n/a
Stephan Koser wrote:
"Christoph Paeper" <ch**************@nurfuerspam.de> schrieb im Newsbeitrag
news:c1***********@ariadne.rz.tu-clausthal.de...
*Stephan Koser*:
Since I have to use the latter DOCTYPE


Why do you *have to* do that?

In Germay we have legal restraints how a web page has to be implemented to
be barrier free. So the doctype should contain also the URL to the DTD.


I suppose you are referring to the BITV. Where does it say, that there
must be a system identifier in the document type declaration?
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #8

P: n/a

"Johannes Koch" <ko**@w3development.de> schrieb im Newsbeitrag
news:c1*************@ID-61067.news.uni-berlin.de...
Stephan Koser wrote:
"Christoph Paeper" <ch**************@nurfuerspam.de> schrieb im Newsbeitrag news:c1***********@ariadne.rz.tu-clausthal.de...
*Stephan Koser*:

Since I have to use the latter DOCTYPE

Why do you *have to* do that?

In Germay we have legal restraints how a web page has to be implemented to be barrier free. So the doctype should contain also the URL to the DTD.


I suppose you are referring to the BITV. Where does it say, that there
must be a system identifier in the document type declaration?


Well, perhaps I am wrong, but I interpreted condition 3.2 that way. Is says:
(sorry, but in original this is in german)

"Mittels Markup-Sprachen geschaffene Dokumente sind so zu erstellen und zu
deklarieren, dass sie gegen veröffentlichte formale Grammatiken validieren."
In (bad) english: documents created by markup languages have to be created
and decalred by validating against public grammars.

I thought this means that the DTD has to be included. Am I wrong (that would
be the easiest solution ;-))?

--
bye Stephan...

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

Jul 20 '05 #9

P: n/a
In article <40**********************@dreader2.news.tiscali.nl >,
el*********@tiscali.nl enlightened us with...
You can set the height to the td instead, as long as you use
css to do it, and not html. But even with css, it won't work
on tr, only on td.


Define "works". :)

If you use IE quirks mode, as the OP originally did, IE does indeed set
the height of the TRs as specified.

--
--
~kaeli~
What's another word for thesaurus?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #10

P: n/a
"Stephan Koser" <no************@web.de> wrote:
"Johannes Koch" <ko**@w3development.de> schrieb im Newsbeitrag
news:c1*************@ID-61067.news.uni-berlin.de...

I suppose you are referring to the BITV. Where does it say, that there
must be a system identifier in the document type declaration?
Well, perhaps I am wrong, but I interpreted condition 3.2 that way. Is says:
(sorry, but in original this is in german)

"Mittels Markup-Sprachen geschaffene Dokumente sind so zu erstellen und zu
deklarieren, dass sie gegen veröffentlichte formale Grammatiken validieren."
In (bad) english: documents created by markup languages have to be created
and decalred by validating against public grammars.


Sounds like 3.2 of the WAI guidelines (hardly surprising, most of the
national rules have copied the WAI guidelines with greater or lesser
numbers of changes).

http://www.w3.org/TR/WCAG10/wai-page...entify-grammar
"Create documents that validate to published formal grammars."
I thought this means that the DTD has to be included. Am I wrong (that would
be the easiest solution ;-))?


Yes, it means you need to include a doctype declaration, but if that
doctype is a well known, well established, publically published one
then there's no need to include the URL. Any HTML validator (or other
software that (a) is likely to parse your page and (b) needs to know
about the actual DTD in use) will know about the HTML 4.01 DTD without
needing to be explicitly pointed at it. If you were using a custom
DTD, or a recently published one then including the URL would be a
good move.

There's also the completely unrelated issue of doctype sniffing and
quirks vs standards mode. As you found out including the URL triggers
standards mode in IE6. If you want to comply with the spirit as well
as the letter of any accessibility regulations then writing your pages
in Strict rather than Transitional and triggering Standards rather the
Quirks mode would probably be a good move. I'm not saying that
Transitional pages are automatically less accessible, just that
writing Strict pages may help to put you as the author in the mindset
to produce accessible pages.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #11

P: n/a
In article <c1**********@online.de>, no************@web.de enlightened
us with...
Hi,

I have a problem since I use a full DOCTYPE.

Not using the full doctype sends IE into quirks mode.
Hence your problem when you add it. It actually complies! *LOL*

This works very well. The whole content fits in the browser window.


If you want a header, content, and a footer to take up the whole window
even when there is not enough content to justify a whole window, use CSS
on divs, not tables (unless you need to support OLD browsers, then
you're stuck with the tables and might mudge by with changing the height
of the middle from 100% to 95%).

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<style type="text/css">
#header {
height: 20px;
width: 100%;
border: thin solid navy;
position: relative;
float: top;
}
#main {
width: 100%;
position: relative;
}
#footer {
height: 50px;
width: 100%;
border: thin solid navy;
position: absolute;
bottom: 20px;
}

</style>
</head>
<body>
<div id="header">this is header content</div>
<div id="main">this is main content</div>
<div id="footer">this is footer content</div>
</body>
</html>

--
--
~kaeli~
What's another word for thesaurus?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #12

P: n/a
Els
kaeli wrote:
In article <40**********************@dreader2.news.tiscali.nl >,
el*********@tiscali.nl enlightened us with...
You can set the height to the td instead, as long as you use
css to do it, and not html. But even with css, it won't work
on tr, only on td.


Define "works". :)

If you use IE quirks mode, as the OP originally did, IE does indeed set
the height of the TRs as specified.


True, but he wanted to add the url to the doctype, and then
he'll have to style the TDs.

--
Els

Mente humana é como pára-quedas; funciona melhor aberta.

Jul 20 '05 #13

P: n/a
Stephan Koser wrote:

I have a problem since I use a full DOCTYPE.


You seem to have a problem multiposting, too.

http://groups.google.com/groups?selm...41%40online.de

http://groups.google.com/groups?selm...41%40online.de

--
Brian (follow directions in my address to email me)
http://www.tsmchughs.com/

Jul 20 '05 #14

P: n/a

"kaeli" <ti******@NOSPAM.comcast.net> schrieb im Newsbeitrag
news:MP************************@nntp.lucent.com...
In article <c1**********@online.de>, no************@web.de enlightened If you want a header, content, and a footer to take up the whole window
even when there is not enough content to justify a whole window, use CSS
on divs, not tables (unless you need to support OLD browsers, then
you're stuck with the tables and might mudge by with changing the height
of the middle from 100% to 95%).
Ok, actually we wanted to use tables. But DIVs would also be fine. Your
samle is ok, but when the main content si too large, it will flow over the
footer. That isn't nice.
We want to convert a page using frames to one without frames. I'm not quite
sure, if it is possible to get the same functionality. But what we want to
have is a fixed header on the very top and a fixed footer at the bottom of
the window. Between we want to have the content area, that is variable in
height. If the content is too large, we want to scroll only the 'main' area.
If this is not possible, it is ok, when we have to scroll the whole page.
But then the footer has to be at the end of the page. When the content is
not enough to fill the content area, the footer has to be at the bottom of
the window.
This should work in the most important Browsers (Netscape, Opera, Mozilla
and IE - also with little browser-specific modifications) and without
JavaScript.
I know this is very hard, but I hope there is a solution.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<style type="text/css">
#header {
height: 20px;
width: 100%;
border: thin solid navy;
position: relative;
float: top;
}
#main {
width: 100%;
position: relative;
}
#footer {
height: 50px;
width: 100%;
border: thin solid navy;
position: absolute;
bottom: 20px;
}

</style>
</head>
<body>
<div id="header">this is header content</div>
<div id="main">this is main content</div>
<div id="footer">this is footer content</div>
</body>
</html>


Thanks.

--
bye Stephan...


Jul 20 '05 #15

P: n/a
In article <c1**********@online.de>, no************@web.de enlightened
us with...

Ok, actually we wanted to use tables. But DIVs would also be fine. Your
samle is ok, but when the main content si too large, it will flow over the
footer. That isn't nice.


Oops.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<style type="text/css">
#header {
height: 20px;
width: 100%;
border: thin solid navy;
position: relative;
float: top;
}
#main {
width: 100%;
position: relative;
overflow: auto;
}
#footer {
height: 50px;
width: 100%;
border: thin solid navy;
float: bottom;
bottom: 20px;
}

</style>
</head>
<body>
<div id="header">this is header content</div>
<div id="main">this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
this is main content<br>
</div>
<div id="footer">this is footer content</div>
</body>
</html>

--
--
~kaeli~
God was my co-pilot... but then we crashed in the mountains
and I had to eat him.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #16

P: n/a
Steve Pugh wrote:
"Stephan Koser" <no************@web.de> wrote:

I thought this means that the DTD has to be included. Am I wrong (that would
be the easiest solution ;-))?

Yes, it means you need to include a doctype declaration, but if that
doctype is a well known, well established, publically published one
then there's no need to include the URL.


For HTML (the OP uses HTML 4.01), a system identifier (URL) is _not_
necessary in a document type declaration. A formal public identifier
("-//W3C//...") is sufficient. For XHTML as an XML application, a system
identifier _is_ necessary.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #17

P: n/a
> Steve Pugh wrote:

Yes, it means you need to include a doctype declaration, but if that
doctype is a well known, well established, publically published one
then there's no need to include the URL.

(publically published :-)

Johannes Koch <ko**@w3development.de> wrote:
For HTML (the OP uses HTML 4.01), a system identifier (URL) is _not_
necessary in a document type declaration. A formal public identifier
("-//W3C//...") is sufficient. For XHTML as an XML application, a system
identifier _is_ necessary.


I once asked in CIWAH if this was true or just a myth and Arjun Ray
assured me it was not true.
Jul 20 '05 #18

P: n/a
Karl Smith wrote:
Johannes Koch <ko**@w3development.de> wrote:
For HTML (the OP uses HTML 4.01), a system identifier (URL) is _not_
necessary in a document type declaration. A formal public identifier
("-//W3C//...") is sufficient. For XHTML as an XML application, a system
identifier _is_ necessary.

I once asked in CIWAH if this was true or just a myth and Arjun Ray
assured me it was not true.


Which of the statements is not true?
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #19

P: n/a
Johannes Koch <ko**@w3development.de> wrote in message news:<c1*************@ID-61067.news.uni-berlin.de>...
Karl Smith wrote:
Johannes Koch <ko**@w3development.de> wrote:
For HTML (the OP uses HTML 4.01), a system identifier (URL) is _not_
necessary in a document type declaration. A formal public identifier
("-//W3C//...") is sufficient. For XHTML as an XML application, a system
identifier _is_ necessary.


I once asked in CIWAH if this was true or just a myth and Arjun Ray
assured me it was not true.


Which of the statements is not true?


The statement immediately preceding my response. I've found it (
http://groups.google.com/groups?hl=e...5hqf%404ax.com
) now:

| My vague recollection is that XML DOCTYPE declarations require a
| system identifier to always be included?

As a matter of fact, no.

http://www.w3.org/TR/REC-xml#sec-prolog-dtd
Jul 20 '05 #20

P: n/a
Karl Smith wrote:
Johannes Koch <ko**@w3development.de> wrote in message news:<c1*************@ID-61067.news.uni-berlin.de>...
Karl Smith wrote:
Johannes Koch <ko**@w3development.de> wrote:
For HTML (the OP uses HTML 4.01), a system identifier (URL) is _not_
necessary in a document type declaration. A formal public identifier
("-//W3C//...") is sufficient. For XHTML as an XML application, a system
identifier _is_ necessary.

I once asked in CIWAH if this was true or just a myth and Arjun Ray
assured me it was not true.


Which of the statements is not true?

The statement immediately preceding my response. I've found it (
http://groups.google.com/groups?hl=e...5hqf%404ax.com
) now:

| My vague recollection is that XML DOCTYPE declarations require a
| system identifier to always be included?

As a matter of fact, no.

http://www.w3.org/TR/REC-xml#sec-prolog-dtd


[28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('['
intSubset ']' S?)? '>'

[75] ExternalID ::= 'SYSTEM' S SystemLiteral
| 'PUBLIC' S PubidLiteral S SystemLiteral

I would read this as: ExternalID must be either
* 'SYSTEM' white-space <system identifier>
or
* 'PUBLIC' white-space <formal public identifier> white-space <system
identifier>

So this requires at least a system identifier.

--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #21

P: n/a
Johannes Koch wrote:
http://www.w3.org/TR/REC-xml#sec-prolog-dtd


[28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('['
intSubset ']' S?)? '>'

[75] ExternalID ::= 'SYSTEM' S SystemLiteral
| 'PUBLIC' S PubidLiteral S SystemLiteral

I would read this as: ExternalID must be either
* 'SYSTEM' white-space <system identifier>
or
* 'PUBLIC' white-space <formal public identifier> white-space <system
identifier>

So this requires at least a system identifier.


Well yes, but ExternalID is optional in the definition of doctypedecl
- see <http://www.w3.org/TR/2004/REC-xml-20040204/#sec-notation>.
Jul 20 '05 #22

P: n/a
Phil Anderton wrote:
Johannes Koch wrote:

http://www.w3.org/TR/REC-xml#sec-prolog-dtd


[28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('['
intSubset ']' S?)? '>'

[75] ExternalID ::= 'SYSTEM' S SystemLiteral
| 'PUBLIC' S PubidLiteral S SystemLiteral

I would read this as: ExternalID must be either
* 'SYSTEM' white-space <system identifier>
or
* 'PUBLIC' white-space <formal public identifier> white-space <system
identifier>

So this requires at least a system identifier.

Well yes, but ExternalID is optional in the definition of doctypedecl
- see <http://www.w3.org/TR/2004/REC-xml-20040204/#sec-notation>.


Oops, yes. I forgot that. But for validating XML against published
formal grammars, there must be an external or an internal subset.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #23

This discussion thread is closed

Replies have been disabled for this discussion.