FIELDSET and LEGEND Tags in Web Design

In this post I will explain one common HTML element used in many websites. The element that I’m talking about is: FIELDSET linked closely with LEGEND. For a standard definition I will cite W3C.

The FIELDSET element allows authors to group thematically related controls and labels. Grouping controls makes it easier for users to understand their purpose. The proper use of this element makes documents more accessible.

The LEGEND element allows authors to assign a caption to a FIELDSET. The legend improves accessibility when the FIELDSET is rendered non-visually.

<fieldset>
<legend>Legend Text</legend>
Sample content here
</fieldset>

What is so cool about these tags?

From my point of view FIELDSET + LEGEND are one good pair. It is one of the best design oriented group of tags in HTML. The best part is that any content will fit well in this container. Let’s have some examples in order to see what is so special about these 2 tags.

1. Wrapper for Content

The first sample is my blog which is not updated: www.gongea.com. The blog was developed based on the FIELDSET + LEGEND. Every article is wrapped in a FIELDSET and the title is displayed from a LEGEND tag. Even the tag cloud and the blogroll are wrapped also in a FIELDSET.

2. Wrapper for Images

In this example the FIELDSET and LEGEND are combined with a picture. Let’s see what we can make from this composition.

Mihaela Drumitascu – 2008

As you can see I’ve added the copyright to this photo using the LEGEND tag. At the same time the FIELDSET is used to add the border around the picture to give it an effect similar to polaroid picture. I’ve used the same spacing, but in order to achieve a polaroid effect you will have to set a bigger value for the bottom padding.

3. Wrapper for Forms

For the forms this approach is the default one. This was the main purpose for FIELDSET and LEGEND. When you have labels and inputs that share a common goal or feature, you can wrap them in order to make your form elements more accessible.

Conclusion

The main idea with this article is that with creativity, simple and relatively dedicated HTML elements can be used in styling a website, or some elements from a website. I don’t know what do you think about FIELDSET and LEGEND, but I think there are great HTML tags for web designers. With the proper CSS code that will follow your design guidelines, these tags can be really helpful. Cheers!

Sponsors

Community Links

  • Create the Toyota logoHi there. In this tutorial you can learn to create the Toyota logo. It is all about circles and the Pathfinder panel. You will have to create a series of circles of exact dimensions. Regarding that,the grid and the snap to grid option will ease your work.
  • 60+ Creative And Well Designed PagesWhen doing my research for 404 error pages, I was surprised to see that three quarters of the websites I visited did not have custom 404 error pages.
  • Design an animated banner in PhotoshopIn this tutorial I will show you how to use Photoshop to create an animated leaderboard banner.
  • Top 10 Websites To Brush Up Your jQuery SkillsTo brush up your skills in jQuery, we present you Top 10 Websites For Free jQuery Tutorials that have been providing some cool demos and step by step guidelines, such that a beginner can master his skills of jQuery easily
  • Top 8 Principles of Effective Website DesigningEverything is guided by certain set of standards, rules and regulations. If the task is not driven by some guidelines, then it could face difficulties for its successful completion.
  • 61 Incredible Logo Designs #3Here’s yet another roundup of amazing logo designs. This is a series that we do frequently, so make sure to check out the past logo articles.
  • 20+ Amazing Product PSD files found on DeviantARTThese are a selection of over twenty PSD files which I have found over on DeviantART, specifically of various electronic products.
  • Create a documents icon in IllustratorHi there. In the next tutorial you’ll learn to create a pretty common icon. To reach this result you need to know how to use the Rectangle Tool, the Pen Tool or the Type Tool.
  • 10 Downing Tweets10 Downing Tweets is a Flash and Twitter based website created by twentysix Leeds. The site includes a twitter vote, a daily poll and an insight on the twitter noise the election is receiving. Will the final results on our site echo who gets elected?
  • 20 Clever Futuristic Free FontsFuturistic fonts were always one of my favorite font styles. I was never that much into grunge and similar styles. I rather keep it clean, but still cool looking. If you like this style, take a look at the collection of 20 free futuristic fonts I put toge