CSS: How to align vertically a “label” and “input” inside a “div”?

后端 未结 7 1363
刺人心
刺人心 2020-11-29 17:59

Consider the following code:

HTML:

7条回答
  •  广开言路
    2020-11-29 18:39

    You can use display: table-cell property as in the following code:

    div {
         height: 100%;
         display: table-cell; 
         vertical-align: middle;
        }
    

提交回复
热议问题