53 of 133 menu

The fieldset tag

The fieldset tag groups HTML form fields.

The result is then outlined in a frame, and the signature, which is created using the tag legend, breaks this frame, creating an effect that is unique by other means (see example).

If you assign any CSS styles for positioning to the legend tag (float, position and etc.), then its content will leave the frame and be in the right place (there will no longer be a gap in the frame).

Example

Let's split the form into two logical blocks using two fieldset tags:

<form> <fieldset> <legend>Buyer details</legend> <input type="text"> </fieldset> <fieldset> <legend>Seller details</legend> <input type="text"> </fieldset> </form>

:

See also

  • property border,
    with which you can set a border for a block
byenru