Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8450987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:07:03+00:00 2026-06-10T11:07:03+00:00

I am currently using twitter bootstrap, which is working nicely, but I would like

  • 0

I am currently using twitter bootstrap, which is working nicely, but I would like to add a legend to the “well” elements that are used in a form (so that I can have multiple wells, denoting sub-sections on a form).

An example of what my form looks like now is:

enter image description here

I would like to add a legend so that I can have two separate sections beneath the “Details” heading, for example, but be able to denote what they are for. A legend seems the best way to do this.

The relevant section of the html looks like:

<form>
   <div class="row">
        <div class="span6">
        <div class="nonboxy-widget">
            <div class="widget-head">
                <h5>Details</h5>
            </div>
            <div class="widget-content">
                 <div class="widget-box">
                    <div class = 'form-horizontal well'>
                        <fieldset>
                            <div class="control-group">
                                <label class="control-label">Sale Type</label>
                                <div class="controls">

When I attempt to add a legend tag to either the fieldset or the div with class form-horizontal well it renders like a heading inside the box, not like a normal html legend. It renders like:

enter image description here

with the code

<div class = 'form-horizontal well'>
  <fieldset>
    <legend>Details</legend>
    <div class="control-group">

Can anyone recommend a way to get this to render like a normal legend, on the border of the box?

EDIT: Thanks to the code from Simbirsk, I now have:

enter image description here

This is pretty close, but what I wanted was to have the legend look like a normal html legend on a fieldset (i.e. for it to sit in the border), so I changed the CSS to:

legend {
padding: 0;
margin-left: 10px;
margin-bottom: -9px;
border: 0;
color: #999999;
background-color: #333333;
}

but that resulted in this:

enter image description here

How can I ensure that the border on the well “breaks” (is not displayed behind the text) like a normal fieldset legend?

EDIT 2: Following the edit to the first answer, I applied the code to my css and ended up with:

enter image description here

You will note this is not quite what I was looking for – I am trying to get the legend on the border of the well div, not on the fieldset itself (because this is a nested form, there could be multiple fieldsets within one well, so I can’t put the border on the fieldset itself).

I seemed to have achieved this with the code above, the only problem was putting a break in the border where the legend is – can this be done with some kind of opacity to the background of the legend text, and a bit of padding?

Any further suggestions?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:07:05+00:00Added an answer on June 10, 2026 at 11:07 am

    Put the .well on the fieldset and override Bootstrap’s legend and fieldset styles.
    HTML

    <form>
        <fieldset class="well the-fieldset">
            <legend class="the-legend">Your legend</legend>
            ... your inputs ...
        </fieldset>
    </form>
    

    CSS

    .the-legend {
        border-style: none;
        border-width: 0;
        font-size: 14px;
        line-height: 20px;
        margin-bottom: 0;
    }
    .the-fieldset {
        border: 2px groove threedface #444;
        -webkit-box-shadow:  0px 0px 0px 0px #000;
                box-shadow:  0px 0px 0px 0px #000;
    }
    

    NOTE: I’ve ommited Bootstrap classes like rows, spans, controls, etc. Use them to fit your layout.
    EDIT: Changed code to include fieldset styles “reset”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not currently using twitter bootstrap, but I do like some of the components.
I'm currently using popovers with Twitter Bootstrap, initiated like this: $('.popup-marker').popover({ html: true, trigger:
I currently have a carousel using Twitter's bootstrap on my website. I'm controlling which
I would like a text similar to Twitter's I am currently using a UITextView
I currently have an app that is using a twitter bootstrap modal box. The
Is it OK to implement Modernizr with Twitter Bootstrap? I'm currently using Bootstrap with
I'm attempting to correctly vertically align offsetting elements using Twitter Bootstrap with a fluid
I am building a twitter application that is currently using the classic login instead
I'm using Twitter's Bootstrap library, version 2.0.3 to prototype a website. I'm currently using
I'm currently using tabs with Twitter Bootstrap and want to select the same tab

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.