[HTML] FIELDSET and LEGEND tags

I'd been styling my forms with divs and CSS - this should simplify things quite a bit:

...one of my co-workers who is something of a css junkie showed me some tags I was not aware of before, and how they can be nicely styled up to give some interesting form effects. The tags are the “fieldset” and “legend” tags which can enclose one or more “form” elements (I won't try to post the html here for fear of skrewing up other dotnetjunkies weblogs). They render quite nicely in IE without styling (see below, I like the rounded corners). And you can style them up with colour (see here towards the bottom). They also display quite nicely in mozilla (albeit without the rounded corners). They are in the HTML 4.01 standard so you have a fighting chance of them working in older browsers too.

[Via WebLogs @ DotNetJunkies.com]

4 Comments

  • coincidentally i just learned of these 2 tags the other day as well. they were used in an ASP.NET 2.0 quickstart example to demonstrate some new functionality on the validation controls. i saw fieldset/legend and said WTF?!

  • I noticed these tags about a year ago on MaximumASP's website when I filled out their forms to sign up with them as a web host.



    The forms were so professional looking that I did a "view source" on the pages to see how they pulled off the attractive look.



    Since then I have used the legend and fieldset tags on quite a few back office applications and customers like the look. I thought I was the only one who had never used them :)

  • Fieldset is in the asp.net 2.0 Panel control as "GroupingText"

    Just one more way to do things different from those great people in Redmond.

  • Wonderful story, reckoned we could combine a number of unrelated information, nevertheless really really worth taking a look, whoa did one particular discover about Mid East has got far more problerms at the same time

Comments have been disabled for this content.