CSS - Exact same height and alignment of button and input text box

后端 未结 12 1421
花落未央
花落未央 2020-12-04 15:40

I need to have a button and a tex box sitting next to each other and they have to align up perfectly as if one is bigger than the other then it will be instantly noticeable.

12条回答
  •  醉梦人生
    2020-12-04 16:35

    .sdiv {
    padding-top: 33px;
    padding-left: 33px;
    height: 123px;
    border: 1px dotted red;
    border-radius: 7px;
    background-color: Black;
    }
    
    .sbtn {
    float:left;
    height:24px;
    width: 24px;
    padding: 3px 0 0 0;
    border:none;
    margin-top: 14px;
    background-color: white;
    }
    
    .stxt {
    width: 180px;
    height:22px;
    float:left;
    border:none;
    padding-left:3px;
    margin-top: 14px;
    }

    All excellent answers! But none were really what I was looking for...

    I got more satisfaction from more straightforward approach:

提交回复
热议问题