Forum Moderators: not2easy
<input type="text" value="inpt1"><span>span1</span>
<input type="text" value="inpt2">
<input type="text" value="inpt3"><span>span2</span>
<input type="text" value="inpt4">
<input type="text" value="inpt5">
<input type="text" value="inpt6">
|inpt1 | |inpt2 | |inpt3 |
<span1 > -------- <span2 >
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>inputs and spans</title>
<style type="text/css">
body {
background-color:#eee;
}
#container {
width:460px;
padding:10px 19px 5px;
border:3px double #999;
margin:auto;
background-color:#ddd;
}
#container div {
clear:both;
margin-bottom:5px;
text-align:center;
overflow:hidden;
}
.inpright,.spnright {
width:142px;
float:right;
}
.inpleft,.spnleft {
width:142px;
float:left;
}
.spnright,.spnleft {
text-align:center;
}
</style>
</head>
<body>
<form action="#">
<div id="container">
<div>
<input class="inpright" type="text" value="inpt3">
<input class="inpleft" type="text" value="inpt1">
<input class="inpcenter"type="text" value="inpt2">
</div>
<div>
<span class="spnright">span2</span>
<span class="spnleft">span1</span>
</div>
<div>
<input class="inpright" type="text" value="inpt6">
<input class="inpleft" type="text" value="inpt4">
<input class="inpcenter"type="text" value="inpt5">
</div>
<div>
<span class="spnright">span4</span>
<span class="spnleft">span3</span>
</div>
</div><!-- end #container -->
</form>
</body>
</html>
also does what you want, and because it uses the appropriate html form elements, is accessibility-friendly
fieldset {
position:relative;
height:50px;/* adjust to suit*/
}
label {
position:absolute;
top:20px; /* adjust to suit*/
}
<fieldset>
<label for="impt1">span1</label>
<input type="text" value="inpt1">
<input type="text" value="inpt2">
<label for="inpt3">span3</label>
<input type="text" value="inpt3">
</fieldset>
<fieldset>
<label for="impt4">span4</label>
<input type="text" value="inpt4">
<input type="text" value="inpt5">
<label for="inpt6">span6</label>
<input type="text" value="inpt6">
</fieldset>
var l = object.position().left;
var t = object.position().top;
t += object.height() + 4;
$("#textboxmsg"+object.attr("id")).css({"left":l,"top":t}).html(' Please check ').show();