1 回答
TA贡献1998条经验 获得超6个赞
您可以将所有输入顶部和左侧移动 1px,这将使边框相互折叠。
然后向容器添加 1px 的内边距。
这将是结果。
.crossword-board-container {
position: relative;
background: #fff;
}
.crossword-board {
background: transparent;
display: grid;
grid-template: repeat(5, 4em) / repeat(5, 4em);
list-style-type: none;
padding: 1px;
margin: 0 auto;
}
.crossword-board input {
margin: -1px 0 0 -1px;
border: 1px solid red;
background: transparent;
text-align: center;
font-size: 20px;
font-weight: bold;
text-transform: uppercase;
}
<div class="crossword-board-container">
<div class="crossword-board">
<!-- ROW 1 -->
<span></span>
<span></span>
<input type="text" minlength="1" maxlength="1" pattern="^[bB]{1}$" />
<span></span>
<span></span>
<span></span>
<span></span>
<input type="text" minlength="1" maxlength="1" pattern="^[bB]{1}$" /> <input type="text" minlength="1" maxlength="1" pattern="^[bB]{1}$" />
<input type="text" minlength="1" maxlength="1" pattern="^[bB]{1}$" />
<input type="text" minlength="1" maxlength="1" pattern="^[bB]{1}$" />
<input type="text" minlength="1" maxlength="1" pattern="^[bB]{1}$" />
<input type="text" minlength="1" maxlength="1" pattern="^[bB]{1}$" />
<span></span>
<span></span>
<span></span>
<span></span>
<input type="text" minlength="1" maxlength="1" pattern="^[bB]{1}$" />
<span></span>
<span></span>
<span></span>
<input type="text" minlength="1" maxlength="1" pattern="^[bB]{1}$" />
<input type="text" minlength="1" maxlength="1" pattern="^[bB]{1}$" />
<input type="text" minlength="1" maxlength="1" pattern="^[bB]{1}$" />
<span></span>
</div>
</div>
- 1 回答
- 0 关注
- 102 浏览
添加回答
举报