我正在尝试创建一个填字游戏,并且我希望在我在框中键入内容后立即将焦点传递到以下框。我也想让它在我删除时倒退。基本上,我希望这两个部分中的每一个都被那个黑框分隔,类似于单个文本输入。
.row {
display: flex;
margin-left: 1.2em;
}
input[type="text"] {
width: 1em;
height: 1em;
font: 700 2em Chiller;
text-align: center;
vertical-align: middle;
padding: 1px;
margin: -1px;
text-transform: capitalize;
border: 2px solid black;
}
<div class="row">
<input type="text" maxlength="1" autocomplete="off" />
<input type="text" maxlength="1" autocomplete="off" />
<input type="text" maxlength="0" autocomplete="off" style="background-color:black"/>
<input type="text" maxlength="1" autocomplete="off" />
<input type="text" maxlength="1" autocomplete="off" />
<input type="text" maxlength="1" autocomplete="off" />
<input type="text" maxlength="1" autocomplete="off" />
<input type="text" maxlength="1" autocomplete="off" />
</div>