Ctrl + C
^ Just why?
Can kbd kbd
get different formatting? How about a nested samp?
<kbd><kbd><samp>File</samp></kbd> <kbd><samp>Save</samp></kbd></kbd>
File Save
As to why you would want to nest them, here it is from the horse's mouth:
When the kbd element is nested inside another kbd element, it represents an actual key or other single unit of input as appropriate for the input mechanism.
Mozilla give two examples of kbd
usage, one of which uses nesting:
<p>Save the document by pressing <kbd><kbd>Ctrl</kbd>+<kbd>S</kbd></kbd></p>
They show the results below on the same page.
kbd
(except that syntactically they can be nested).
Aug 11, 2014 at 20:09
Nested kbd
elements look what they look at SO just because SO defines their style so that they look like buttons of a kind. If you nest them, the result thus looks like a button inside a button. The button-like appearance is meant to make things look like keyboard keys, more or less. The practical implication is that at SO, you should use kbd
only for describing keypresses.
Since kbd
means user input (or specifically keyboard input), there is no logical reason to nest kbd
elements. There is often need to indicate that some keypresses belong together (e.g., you are expected to press the “C” key while keeping the “Ctrl” key pressed down, instead of pressing first “Ctrl”, then “C”). There is no really satisfactory way to do that. You normally need to rely on general understanding or on verbal explanations.
<i>..</i>
nested in itself be regular again?"
I was trying to figure out what you were talking about, then I realized I have custom CSS to fix this annoying issue:
kbd kbd, blockquote blockquote {
background: none;
border: 0;
box-shadow: none;
margin: 0;
padding: 0;
}
Note I also use these same styles to prevent the annoying nested blockquotes.
<samp>
tags but why on earth would you want to use nested<kbd>
s anywhere?<samp>
, so you are correct.(Ctrl+C), (Shift+D)
as distinguished from(Ctrl), (C), (Shift), (D)
or(Ctrl+C+Shift+D)
-- presuming that(Ctrl+C)
and(Ctrl+D)
are a single "unit" of input each, as it were.