Align vertically input elements in div

后端 未结 2 497
时光说笑
时光说笑 2021-01-24 14:16

I\'ve made a search on SO to know how can I align vertically input elements in a div. This div is inside a form. Most of questions, form elements have a lot of

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-24 14:46

    Add position: relative;top: 50%;margin: 1px; to your .fillform div input class and try this:

    .fillform{
         width: 100%;
         height: 33%;
         bottom: 0;
         background: rgba(225, 43, 50, 1.0);
    }
    
    .fillform div{
         float: left;
         width: 100%;
         height: 200px;
         box-sizing: border-box;
         border: 2px solid rgba(0,0, 255, 1.0);
    }
    
    .fillform div input{
         float: left;
         border: 2px solid rgba(255, 0, 0, 1.0);
         box-sizing: border-box;
         position: relative;
         top: 50%;
         margin: 1px;
    }
    

提交回复
热议问题