A fieldset with legend provides visual and semantic grouping for form controls. You can then create the style as you wish using CSS. A fieldset somewhat unique in that legend is able to visually interrupt the border of its parent fieldset (possibly 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" /> </fieldset>
fieldset { margin: 8px; border: 1px solid silver; padding: 8px; border-radius: 4px; } legend { padding: 2px; }
Tim Medora Sep 24 '12 at 19:59 2012-09-24 19:59
source share