首页 > 解决方案 > 在 HTML 中调整输入框文本区域的大小

问题描述

我是 HTML 新手,我正在尝试调整输入框的大小。这是我的代码

<!DOCTYPE html>
<html>
<body>

<h1> Text Summarizer </h1>
<div class="login">
<h1>Insert the text that you want to summarize in the box below</h1>

  <form action="{{url_for('summary')}}"method="post">
    <input type="text" name="input" placeholder="type here" required="required"> 
    <br><br>
    <input type="submit",value="summary">
  </form> 
  <br>
  <br>
  {{data}}
  </div>

这是我尝试过的。

<!DOCTYPE html>
<html>
<body>

<h1> Text Summarizer </h1>
<div class="login">
<h1>Insert the text that you want to summarize in the box below</h1>

  <form action="{{url_for('summary')}}"method="post">
    <input type="text" name="input" placeholder="type here" required="required"> 
    <br><br>
   <textarea rows= "4" cols="50">
   </textarea>
   <br><br>
    <input type="submit",value="summary">
  </form> 
  <br>
  <br>
  {{data}}
  </div>

我现在在原始文本框旁边得到了第二个框。任何帮助都感激不尽。

标签: htmltextboxresize

解决方案


如果您希望它是一个带有“在此处输入”占位符的大文本字段,请执行以下操作:

<!DOCTYPE html>
<html>
<body>

<h1> Text Summarizer </h1>
<div class="login">
<h1>Insert the text that you want to summarize in the box below</h1>

  <form action="{{url_for('summary')}}"method="post">
   <textarea rows= "4" cols="50" type="text" name="input" placeholder="type here" required="required">
   </textarea>
   <br><br>
    <input type="submit" value="summary">
  </form> 
  <br>
  <br>
  {{data}}
  </div>


推荐阅读