Click to See Complete Forum and Search --> : NS7 Label Display Block


Jeff Mott
07-13-2003, 07:20 PM
Wondering if anyone knew why NS7 will not display a label as a block level element. e.g.,<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html lang="en-us">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title></title>
</head>

<body>

<label for="you" style="display: block">Foo</label><input id="you" type="text">

</body>

</html>

Hester
07-14-2003, 04:21 AM
Maybe label is treated as an element that doesn't fit with the normal document flow. Try wrapping it in a div.

Charles
07-14-2003, 05:26 AM
The LABEL and INPUT elements, like all of the form control elements, are inline level in HTML 4.01 Strict and need to be enclosed in a block level element.

Jeff Mott
07-14-2003, 06:16 AM
display: block is supposed to render any element, whether originally block-level or inline, as if it were block-level. This is the effect it has on all other elements, except for LABEL in Netscape only. I know I could wrap it in a DIV, but I shouldn't need to.

Hester
07-14-2003, 06:18 AM
Have you tried applying the style via a stylesheet instead?

Charles
07-14-2003, 06:28 AM
CSS doesn't work properly if your HTML is invalid. And the HTML you have posted is invalid. However, I've run your mark up above through Netscape 7 and I don't see a problem.

Jeff Mott
07-14-2003, 07:29 AM
And the HTML you have posted is invalidSorry, careless mistake.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html lang="en-us">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title></title>
</head>

<body>

<p>
<label for="you" style="display: block">Foo</label><input id="you" type="text">
</p>

</body>

</html>The effect is still the same. I've attached a pic of what I see when viewed with NS7.0.

Hester
07-14-2003, 07:43 AM
Isn't there supposed to be a FORM tag in there?

Works fine in Mozilla 1.4.

Charles
07-14-2003, 09:28 AM
You don't need the FORM element but something else, very strange is going on. When I cut and paste your mark up I find that the elements are displaying properly in Netscape 7 and several other browsers.

Hester
07-14-2003, 09:40 AM
Then it must be the doctype. I know Netscape 6.2 has a bug with certain types. Or it's the meta tags.

Jeff Mott
07-14-2003, 11:32 AM
but something else, very strange is going onI found some known issues regarding floated labels (http://simon.incutio.com/archive/2002/09/12/theFloatLabelBug), but nothing mentioning problems displaying as block-level. Errr, maybe it's just my comp. :\I find that the elements are displaying properly in Netscape 7What was the minor version (7.?) Maybe it was a bug they fixed and I havn't updated my software. If this is the case, though, I would then need to know how many copies of that browser version are in use to decide how important it is to accomodate this bug or just ignore it.

blufive
07-14-2003, 04:07 PM
Open Bug Databases (http://bugzilla.mozilla.org/) are cool.

The culprit appears to be bug #96813 (http://bugzilla.mozilla.org/show_bug.cgi?id=96813)

It was reported in August 2001, and fixed in November 2002. Therefore it was present from about Mozilla 0.9.4 until Mozilla 1.3 alpha.

It appears to have been caused by a fix to an even more severe problem with label elements, so things are probably even worse in earlier versions.

Those mozilla Releases cover Netscape 6.2.x (based on Mozilla 0.9.4) to Netscape 7.0.x (Mozilla 1.0)

Netscape 7.1 is based on Mozilla 1.4, and should therefore work fine. personally, I reckon NN7.1 should have had a bigger jump in version number - there are enough behind-the-scenes fixes in there to justify a jump to 7.5, at least.