
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML Tag
The <code> tag is used to format code in an HTML document. For example, if you want to write Java code and format it properly, then use the <code> element in HTML.
Let us now see an example to implement the <code> element in HTML −
Example
<!DOCTYPE html> <html> <body> <h1>Header Files</h1> <h2>C++</h2> <code> #include <iostream> </code> <h2>C</h2> <code> #include <stdio> </code> </body> </html>
Output
In the above example, we have set a small code snippet; header files in C and C++ on our web page −
<h2>C++</h2> <code> #include <iostream> </code>
The header file is set inside the <code> element that formats the code accordingly −
<code> #include <iostream> </code>
- Related Articles
- Bootstrap code tag styling
- HTML Tag
- HTML Tag
- HTML Tag
- HTML Tag
- HTML Tag
- HTML Tag
- HTML Tag
- HTML Tag
- HTML Tag
- HTML Tag
- HTML Tag
- HTML Tag
- HTML tag
- HTML Tag
- HTML Tag

Advertisements