Previous Message
Next Message

RE: [css-d] buggy(?) style on label in nn6.1

Sent by RUST Randal on 5 February 2002 09:09


----------
>And lo, it floated and looked as I expected in IE 5.5. But 
>when I tested in
>NN6.1, it did not appear as I expected.
----------

Doug,

Netscape does not support the <label> tag.  Below is code that works in IE
6, NN 6.2 and O 6.  It probably works in IE 5+, but I haven't checked to be
sure.

----------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>Untitled</title>
	<style type="text/css" media="screen">
body {
	font-family: arial;
	font-size: 12px;
	line-height: 17px;
	color: black;
	background-color: inherit; }

form {
	display: inline;
	height: auto; }
	
fieldset {
	width: 600px;
	height: 500px;
	padding: 10px;
	border: 2px solid black; }
	
legend {
	font-weight: bold;
	color: #990000;
	background-color: inherit; }
	
div.row {
	position: relative;
	width: 598px;
	height: 25px;
	margin-top: 10px; }	
	
span.label {
	float: left;
	width: 135px;
	color: inherit;
	background-color: #E2E2E2;
	padding-right: 5px;
	margin-right: 10px;
	line-height: 23px;
	font-weight: bold;
	text-align: right; }		

	</style>
	<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
</head>
<body>
	<form name="form" id="form" action=" ">
	<fieldset>
		<legend>this is the legend</legend>
		<div class="row"><label for="a"><span class="label">First
Name:</span></label><input type="text" id="a" /></div>
		<div class="row"><label for="b"><span class="label">Last
Name:</span></label><input type="text" id="b" /></div>
	</fieldset>
	</form>
</body>
</html>

----------

It could probably be a little cleaner, but it does the trick.

Randal
Previous Message
Next Message

Possibly related: