Liquid textfield width

前端 未结 2 975
走了就别回头了
走了就别回头了 2021-01-16 18:12

I have this fairly simple form:

2条回答
  •  鱼传尺愫
    2021-01-16 18:24

    Yeah length is for character count, not width.

    You want the text box to fill all available space short of what the button takes up? This is doable with a table (but I consistently get booed on Stack Overflow for suggesting tables). Let's say for the sake of argument you use DIVs with display:table, but just for simplicity I'll illustrate with actual table markup.

    The width 0 on the button cell might seem odd, but table cells take their widths only as suggestions. It'll stretch to fit the content no matter how skinny you make it.

提交回复
热议问题