# 在 \<kbd\> 标签内，无法在表情符号旁边插入空格

**URL:** <https://meta.discourse.org/t/cant-insert-space-next-to-an-emoji-inside-kbd-tags/248059>\
**Category:** UX\
**Created:** [2022 年12 月 6 日 22:47 UTC](https://meta.discourse.org/t/cant-insert-space-next-to-an-emoji-inside-kbd-tags/248059 "2022-12-06T22:47:01Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

作者： ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)\
发布日期： [2022 年12 月 8 日 18:08 UTC](https://meta.discourse.org/t/cant-insert-space-next-to-an-emoji-inside-kbd-tags/248059/6 "2022-12-08T18:08:17Z")

</div>

我认为我们可以为此使用 `gap` 属性？问题在于将 `kbd` 改为使用 flexbox 会移除元素之间的任何自然空间：

```css
kbd {
  gap: 0.5em;
}

```

产生：

![Screenshot 2022-12-08 at 1.06.10 PM](https://global.discourse-cdn.com/meta/original/4X/5/c/7/5c7645afaffbbbe32825d44bfb62c337190fcfec.png)

这将为 KBD 标签内的任何 HTML 元素添加间距，并且不需要对 first/last-child 进行任何例外处理。

---

_[View the full topic](https://meta.discourse.org/t/cant-insert-space-next-to-an-emoji-inside-kbd-tags/248059)._
