W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > April to June 2002

RE: CSS Positioning Solution was: CSS positioning aint good enoug h?

From: RUST Randal <RRust@COVANSYS.com>
Date: Fri, 26 Apr 2002 09:34:24 -0400
Message-ID: <37925254B67DD311876C009027B0FF9201D3AF5B@cbscolex01.cbsinc.com>
To: "WAI (E-mail)" <w3c-wai-ig@w3.org>
In August of last year, AListApart ran an article by Mark Newhouse called
"Practical CSS Layout."


In the article, he showed how to display a form with CSS.  I thought that
there was too much markup being used, so I set out to create my own CSS
form.  The following markup works in IE 5+, NN 6+ and Opera 6+.  It it
written in XHTML, styled with CSS and validates perfectly.  It also displays
well in the Lynx emulator.

You can view the file online here:

And here is the markup:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<style type="text/css" media="screen">
	body {
		font-family: arial;
		font-size: 12px;
		line-height: 17px;
		color: black;
		background-color: inherit; }
	form {
		display: block; }
	fieldset {
		width: 576px;
		height: auto;
		padding: 10px;
		border: 2px solid black; }
	legend {
		font-weight: bold;
		color: #990000;
		background-color: inherit; }
	div.controls {
		width: 600px;
		margin-top: 1em;
		text-align: right; }	
	div.row {
		position: relative;
		height: 25px;
		margin-top: 10px; }	
	span.label {
		float: left;
		width: 135px;
		color: #000000;
		background-color: #e2e2e2;
		padding-right: 5px;
		margin-right: 10px;
		line-height: 23px;
		font-weight: bold;
		text-align: right; }		

	<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
	<form name="form" id="form" action=" ">
		<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>
		<div class="controls"><input type="submit" id="submit"
value="Submit" /></div>

Randal Rust
Covansys, Inc.
Columbus, OH
Received on Friday, 26 April 2002 09:33:47 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 13 October 2015 16:21:18 UTC