How to force free CSS resize on input element when its width is specified?

后端 未结 4 1332
刺人心
刺人心 2021-02-05 15:30

I have simple problem - text input element which has specified 2 CSS attributes, see code below:



        
4条回答
  •  日久生厌
    2021-02-05 16:03

    Here is an example of using div with flexbox & contenteditable=true instead of input. Only CSS + HTML. I found it useful if no tag 'form' required.

    #flex {
      display: flex;
      display: -webkit-flex;
      line-height: 30px;
    }
    #inner {
        padding: 0 20px;
        min-width: 100px;
        height:30px;
        line-height:30px;
        outline:none;
        background-color: #dfd4d7;
    }
    Type some text here:

提交回复
热议问题