Web Design / HTML

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

<fieldset></fieldset>

By Jennifer Kyrnin, About.com

<fieldset> Description:

The <fieldset> element allows authors to group labels and controls that are thematically related.

<fieldset> Web Browser Support:

<fieldset> Attributes:

<fieldset> End Tag:

</fieldset> REQUIRED

Contents:

HTML forms and the elements to create them. The following tags are valid within the <fieldset> tag:
a, abbr, acronym, address, applet, b, basefont, bdo, big, blockquote, br, button, center, cite, code, dfn, dir, div, dl, em, fieldset, font, form, h1, h2, h3, h4, h5, h6, hr, i, iframe, img, input, isindex, kbd, label, legend, map, menu, noframes, noscript, object, ol, p, pre, q, s, samp, script, select, small, span, strike, strong, sub, sup, table, textarea, tt, u, ul, var

<fieldset> Valid Context:

The <fieldset> tag is valid within the following tags:
blockquote, body, center, dd, div, fieldset, form, iframe, li, noframes, noscript, object, td, th

<fieldset> Usage:

  • standard fieldset
    <form>
    <fieldset>
    <input type="text" name="fname" value="firstname" />
    <input type="text" name="lname" value="lastname" />
    <input type="submit" />
    </fieldset>
    </form>
  • fieldset with legend
    <form>
    <fieldset>
    <legend>Please enter your full name</legend>
    First Name: <input type="text" name="fname" /><br />
    Last Name: <input type="text" name="lname" /><br />
    <input type="submit" />
    </fieldset>
    </form>

<fieldset> Special Notes:

  • Older browsers may not support this tag, or may support it in unexpected ways. Be sure to test across browsers when you use it.
  • This tag is well suited to styling your forms with CSS.

More <fieldset> Information:

Return to XHTML Element (HTML Tags) Library

Explore Web Design / HTML

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Web Design / HTML

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

©2009 About.com, a part of The New York Times Company.

All rights reserved.