示例网址:
https://50projects50days.com/projects/event-keycodes/
http://50projects.tc.cluski.top/50projects50days/event-keycodes/
效果:

思路:
在js中监听keydown事件,从event对象中取出key、keyCode和code值,然后通过element.innerHTML来替换掉原本的DOM。
在布局方面,每个框子用margin来控制中间的间距,使用min-width来控制每个框子不要太小。使用font-weight来控制字体的粗细。
评论区