I've just ran into the <kbd>
tag for the first time, and it doesn't appear to do anything besides default the text to monospace, which can be done by simply changing the font to monospace using CSS. Does the <kbd>
tag have some underlying logic to it that makes it practical, similar to how the <time>
tag translates the code to be machine-readable?
I've traditionally seen in-text changes done via a <span>
tag, and it appears the <kbd>
tag displays the exact same output as a <span>
tag with font-family: monospace
. What is the point of the <kbd>
tag if it simply changes the font? I've searched on SO and other websites for an explanation, but haven't found anything besides the change in font.
span {
font-family: monospace;
}
<p>Please press <span>Ctrl</span> + <kbd>Shift</kbd>.
`. What's the point? All it does it make the text bigger. But like `` the value lies it the semantics.
– j08691 Apr 01 '19 at 20:02