How to define keyboard input in HTML5 ? Last Updated : 12 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The phrase tag is used to define the keyboard input. The text enclosed by <kbd> tag is typically displayed in the browser’s default monospace font. In this article, we define the keyboard input by using various types of tags like <kbd>, <code>, <em>, <var>, and <samp>. Syntax: <kbd> Contents... </kbd> Example 1: html <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title> How to define keyboard input </title> </head> <body> <h2> How to define a various Keyboard input. </h2> <kbd>GeeksForGeeks</kbd> <em>It is a emphasized text</em> <br /> <strong> It is a Strong text </strong> <br /> <code> It is a piece of computer code </code> <br /> <samp> Sample output from a computer program </samp> <br /> <kbd>Keyboard input</kbd><br /> <var>Variable</var> </body> </html> Output: Example 2: html <!DOCTYPE html> <html> <head> <title> How to define keyboard input in HTML5? </title> <style> body { text-align: center; } </style> </head> <body> <div class="gfg"> GeeksforGeeks </div> <h2> <kbd> HTML5: How to define keyboard input? </kbd> </h2> <kbd>A computer</kbd> <kbd>science</kbd> <kbd>portal</kbd> </body> </html> Output: Supported Browsers: Google Chrome Internet Explorer Firefox Opera Safari Comment More infoAdvertise with us Next Article Must Do Coding Questions - Topic-wise M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML HTML-Misc Similar Reads Interview PreparationInterview Preparation For Software DevelopersMust Coding Questions - Company-wise Must Do Coding Questions - Topic-wiseCompany-wise Practice ProblemsCompany PreparationCompetitive ProgrammingSoftware Design-PatternsCompany-wise Interview ExperienceExperienced - Interview ExperiencesInternship - Interview ExperiencesPractice @GeeksforgeeksProblem of the DayTopic-wise PracticeDifficulty Level - SchoolDifficulty Level - BasicDifficulty Level - EasyDifficulty Level - MediumDifficulty Level - HardLeaderboard !!Explore More...Data StructuresArraysLinked ListStackQueueBinary TreeBinary Search TreeHeapHashingGraphAdvance Data StructuresMatrixStringAll Data StructuresAlgorithmsAnalysis of AlgorithmsSearching AlgorithmsSorting AlgorithmsPattern SearchingGeometric AlgorithmsMathematical AlgorithmsRandomized AlgorithmsGreedy AlgorithmsDynamic ProgrammingDivide & ConquerBacktrackingBranch & BoundAll AlgorithmsProgramming LanguagesCC++JavaPythonC#Go LangSQLPHPScalaPerlKotlinWeb TechnologiesHTMLCSSJavaScriptBootstrapTailwind CSSAngularJSReactJSjQueryNodeJSPHPWeb DesignWeb BrowserFile FormatsComputer Science SubjectsOperating SystemsDBMSComputer NetworkComputer Organization & ArchitectureTOCCompiler DesignDigital Elec. & Logic DesignSoftware EngineeringEngineering MathematicsData Science & MLComplete Data Science CourseData Science TutorialMachine Learning TutorialDeep Learning TutorialNLP TutorialMachine Learning ProjectsData Analysis TutorialTutorial LibraryPython TutorialDjango TutorialPandas TutorialKivy TutorialTkinter TutorialOpenCV TutorialSelenium TutorialGATE CSGATE CS NotesGate CornerPrevious Year GATE PapersLast Minute Notes (LMNs)Important Topic For GATE CSGATE CoursePrevious Year Paper: CS exams Like