NS7 Label Display Block

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>Maybe label is treated as an element that doesn't fit with the normal document flow. Try wrapping it in a div.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.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.Have you tried applying the style via a stylesheet instead?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.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.Isn't there supposed to be a FORM tag in there?

Works fine in Mozilla 1.4.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.Then it must be the doctype. I know Netscape 6.2 has a bug with certain types. Or it's the meta tags.but something else, very strange is going onI found some known issues regarding floated labels (<!-- m --><a class="postlink" href="http://simon.incutio.com/archive/2002/09/12/theFloatLabelBug">http://simon.incutio.com/archive/2002/0 ... atLabelBug</a><!-- m -->), 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.Open Bug Databases (<!-- m --><a class="postlink" href="http://bugzilla.mozilla.org/">http://bugzilla.mozilla.org/</a><!-- m -->) are cool.

The culprit appears to be bug #96813 (<!-- m --><a class="postlink" href="http://bugzilla.mozilla.org/show_bug.cgi?id=96813">http://bugzilla.mozilla.org/show_bug.cgi?id=96813</a><!-- m -->)

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.
 
Back
Top