无法在输入文字栏位中输入

问题描述:

我无法在输入字段中键入.当我删除第一个具有id ="viewport"的div时,我可以在输入字段中键入.我该如何解决?

I am not able to type in the input field. When I remove the first div that has the id="viewport" I am able to type in the input field. How am I able to solve this?

<div id="viewport"></div>
<div class="form">
  <h2 id="h2">Need a project from<br>Google Cloud Storage?</h2>
  <form id="fileDownloadForm" method="GET" action="downloadBlob2" enctype="multipart/form-data">
    <input type="text" id="textBox" name="objectToSearch" placeholder="Type the name of the project here." />
    <button id="downloadBtn" type="submit" class="btn btn_primary">Download</button>
  </form>
</div>

您可以通过添加CSS属性 #textBox {z-index:1000;} .似乎视口块太大,并且输入字段溢出.z-index使输入字段更加重要"-越大,元素变得越重要.

You may solve this by adding css attribute #textBox{ z-index:1000; }. It seems that viewport block is too big and overflowing the input field. z-index makes the input field more "important" - the bigger it is, the more important the element becomes.