pub struct Kbd;Expand description
The <kbd> element - keyboard input.
§Purpose
The <kbd> element represents user input from a keyboard, voice input, or any other
text entry device. It’s used to indicate keys, key combinations, or commands that
users should enter.
§Content Categories
- Flow Content
- Phrasing Content
- Palpable Content
§Permitted Content Model
- Phrasing content
§Common Use Cases
- Keyboard shortcuts
- Keys to press
- Command-line commands user should type
- Menu selections or button presses
§Key Attributes
- Global attributes only
§Example
<p>Press <kbd>Ctrl</kbd>+<kbd>C</kbd> to copy.</p>
<p>Save the file with <kbd>Ctrl</kbd>+<kbd>S</kbd>.</p>
<p>To quit, type <kbd>exit</kbd> and press <kbd>Enter</kbd>.</p>
<p>Use <kbd><kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Delete</kbd></kbd> to restart.</p>§Accessibility
- Screen readers may announce keyboard input distinctly
- Helps users identify actionable keyboard commands
§WHATWG Specification
Trait Implementations§
Source§impl HtmlElement for Kbd
impl HtmlElement for Kbd
impl<T: PhrasingContent> CanContain<T> for Kbd
impl CanContain<Text> for Kbd
impl FlowContent for Kbd
impl PalpableContent for Kbd
impl PhrasingContent for Kbd
Auto Trait Implementations§
impl Freeze for Kbd
impl RefUnwindSafe for Kbd
impl Send for Kbd
impl Sync for Kbd
impl Unpin for Kbd
impl UnwindSafe for Kbd
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more