Bootstrap: Input inside a label

前端 未结 2 820
广开言路
广开言路 2021-01-18 08:39

In order to avoid having to have an ID for each input element on my form I would like to place my form input inside the label (Bootstrap 3).

My problem

2条回答
  •  终归单人心
    2021-01-18 08:44

    The solution is to use the label itself as the form-group, remove the row, and to add a style to the CSS that sets display: block for labels. I have inlined the style in this HTML to show what I mean, obviously you should put it into a CSS.

提交回复
热议问题