Is the fieldset tag only really for use in form layout, or can you use it in other instances if you wish? Whats the best practice with this one guys?
cheers
| SitePoint Sponsor |

Is the fieldset tag only really for use in form layout, or can you use it in other instances if you wish? Whats the best practice with this one guys?
cheers
As far as I know the fieldset should tag should only be used for form data, as it's a container for 'fields' in a form.
<fieldset> elements should only be used in <form> elements.
CSS can be used to achieve the look of a <fieldset> with other elements.
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


The wording in the DTD makes it quite clear that FIELDSET is only to be used in forms:
Code:<!ELEMENT FIELDSET - - (#PCDATA,LEGEND,(%flow;)*) -- form control group -->
Birnam wood is come to Dunsinane


And for how to use them with CSS, check out Tyssen's article Legends of Style.
Save the Internet - Use Opera | May my mother rest in peace: 1943-2009
Dan Schulz - Design Team Advisor | Follow me on Twitter
SitePoint References: HTML CSS JavaScript | Become A Guru
WordPress SEO Checklist | What WordPress Plugins Do You Use?
Web Standards Curriculum | Image Free Equal Height Columns
Bookmarks