How to make text input box to occupy all the remaining width within parent block?

后端 未结 6 1901
星月不相逢
星月不相逢 2020-12-04 13:15

How do achieve the following:

┌────────────────────parent────────────────────┐
│ label [text-box                   ] [button] │
│ paragraph                           


        
6条回答
  •  隐瞒了意图╮
    2020-12-04 13:46

    It works without flex and tables if assign float: right and put the button (or several buttons in reverse order) before the input box.

    Then place the label with float: left, give the input box 100% width and wrap it inside a span with display: block and overflow: hidden.

    No magic involved:

    The basic idea that all right side buttons are specified before the input box in the reverse order.

提交回复
热议问题