A fieldset
with a legend
provides a visual and semantic grouping for form controls. You can then style this as desired with CSS. A fieldset
is somewhat unique in that the legend
is capable of visually interrupting the border of its parent fieldset
(possible with other elements, but difficult).
Example: http://jsfiddle.net/NUMcr/1/
<fieldset>
<legend>Group 1</legend>
<input type="text" />
<asp:Textbox runat="Server" id="txt1" />
<!-- etc -->
</fieldset>
fieldset {
margin: 8px;
border: 1px solid silver;
padding: 8px;
border-radius: 4px;
}
legend {
padding: 2px;
}