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

后端 未结 12 1422
花落未央
花落未央 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:26

    Use a background div with an image for the input. That is much easier to keep consistent. Also, absolute positioning is good for this type of situation.

    edit: I wrote this answer 5 years ago, there are better ways now.

提交回复
热议问题