How do I align a label and a textarea?

前端 未结 7 1775
傲寒
傲寒 2020-12-04 22:57

My code ends up like:

             XXXXX
             XXXXX
Description: XXXXX

I want:

             XXXXX
Description: XXXX         


        
7条回答
  •  抹茶落季
    2020-12-04 23:33

    Align the text area box to the label, not the label to the text area,

    label {
        width: 180px;
        display: inline-block;
    }
    
    textarea{
        vertical-align: middle;
    }
    
    
    

提交回复
热议问题