I would like to use the
<kbd> tag in a comment to refer to a keyboard shortcut. Is there a reason why this doesn't seem to be possible? I've tried it at the webapps stackexchange.
No, you cannot.
Comments only support a very limited form of markdown syntax, affectionately called "mini-markdown". And they definitely don't support HTML tags, which are required for
<kbd> to work.
It's relatively rare to need to display keyboard shortcuts in comments. If you need this much formatting, you should probably be posting an answer instead.
workaround hack, use inline code formatting to make keyboard shortcuts stand out. For example:
Press `Alt`+`F4` to solve your problem.
F4 to solve your problem.