How to make

后端 未结 12 1235
日久生厌
日久生厌 2020-12-12 15:37

I am creating a registration form for a website. I want each label and its corresponding input element to appear on the same line.

Here\'s my code:

12条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-12 16:34

    I found "display:flex" style is a good way to make these elements in same line. No matter what kind of element in the div. Especially if the input class is form-control,other solutions like bootstrap, inline-block will not work well.

    Example:

    More detail about display:flex:

    flex-direction: row, column

    justify-content: flex-end, center, space-between, space-around

    align-items: stretch, flex-start, flex-end, center

提交回复
热议问题