Bootstrap - Adding legend to well

后端 未结 2 916
既然无缘
既然无缘 2021-02-05 08:23

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 w

2条回答
  •  不思量自难忘°
    2021-02-05 08:41

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

    Your legend ... your inputs ...

    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".

提交回复
热议问题