根据Bootstrap中的内容更改输入字段的高度

huangapple go评论100阅读模式
英文:

Change input field height based on the content inside in Bootstrap

问题

我正在尝试将内容适应到Bootstrap输入字段中,但它甚至没有绑定。请找到需要根据内容大小增加高度的代码行。

  1. <input type="text" autocomplete="off" class="form-control"
  2. name="typeOfOwnership"
  3. [(ngModel)]="newJson?.basicDetails.typeOfOwnership[0].typeOfOwnershipName"
  4. readonly>

根据Bootstrap中的内容更改输入字段的高度

英文:

I am trying to fit content inside the bootstrap input field and it is not even binding. Please find the code line in which I need to adjust height as the content size increases.

  1. &lt;input type=&quot;text&quot; autocomplete=&quot;off&quot; class=&quot;form-control&quot;
  2. name=&quot;typeOfOwnership&quot;
  3. [(ngModel)]=&quot;newJson?.basicDetails.typeOfOwnership[0].typeOfOwnershipName&quot;
  4. readonly&gt;

根据Bootstrap中的内容更改输入字段的高度

答案1

得分: 2

当您的内容较多时,应使用文本区域

尝试使用这个

  1. <textarea [(ngModel)]="newJson?.basicDetails.typeOfOwnership[0].typeOfOwnershipName" readonly></textarea>
英文:

When your content is bigger, you should be using a Textarea instead.

try using this

  1. &lt;textarea [(ngModel)]=&quot;newJson?.basicDetails.typeOfOwnership[0].typeOfOwnershipName&quot; readonly&gt;&lt;/textarea&gt;

huangapple
  • 本文由 发表于 2020年1月3日 17:31:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/59576042.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定