我想删除按钮之间的空格,例如,当我将鼠标悬停在NORMAL按钮上时,它与HARD按钮之间没有空格。我该怎么做,这些空白空间从哪里来?删除HTML中按钮之间的空格,CSS
body {
margin: 0;
}
#stripe {
background-color: white;
text-align: center;
height: 50px;
color: black;
}
button {
border: none;
background: none;
text-transform: uppercase;
height: 100%;
font-weight: 700;
color: black;
letter-spacing: 1px;
font-size: inherit;
transition: all 0.3s;
outline: none;
}
button:hover {
color: white;
background: black;
}
.selected {
color: white;
background: black;
}
<div id="stripe">
<button class="mode">Easy</button>
<button class="mode">Normal</button>
<button class="mode selected">Hard</button>
</div>
回车如何在这些空白处返回结果? –
@HuyTran它是一个空格字符,并且元素是“内联块”,因此它们以内联方式显示。就像你会在HTML中或''标签之间看到'这些单词之间的空格',或者在单词/跨度之间有回车符的地方,你会看到元素之间的空格/返回值设置为'inline'和'内联块' –