How to Remove Fieldset Margins with CSS

How to Remove Fieldset Margins with CSS thumbnail
You can remove the margins from around your fieldsets by changing their style properties in the Web page's header.

In HTML Web page terms, a fieldset is a group of related elements within a form. Using it causes the browser window to draw a box around and apply a common style to all of the elements within the <fieldset> tag, simplifying the process of styling your form. However, you may find that you don't particularly care for the default styles that are applied to the elements when using a fieldset, such as the margins placed around them. Fortunately, the <fieldset> tag accepts CSS style elements, making the removal of margins a simple task.

Instructions

    • 1

      In your preferred text editor, open the Web page containing the fieldsets from which you wish to remove the margins.

    • 2

      Insert the following code in the <head> section of your Web page:

      <style type="text/css>

      fieldset {margin:0px}

      </style>

    • 3

      Save and publish your Web page. The margins will be removed from around your fieldsets.

Tips & Warnings

  • If you wish to remove the margins from around only one fieldset, ignore Step 2 and insert the following code in the appropriate <fieldset> tag:

  • style="margin:0px"

Related Searches:

References

  • Photo Credit Comstock/Comstock/Getty Images

Comments

You May Also Like

Related Ads

Featured