logo rip
RIP Tutorial
  • Tags
  • Topics
  • Examples
  • eBooks
Download HTML (PDF)

HTML

  • Getting started with HTML
  • Upscaling your web development business
  • What Kind of Hosting Should a Student Choose?
  • Awesome Book
  • Awesome Community
  • Awesome Course
  • Awesome Tutorial
  • Awesome YouTube
  • Anchors and Hyperlinks
  • ARIA
  • Canvas
  • Character Entities
  • Classes and IDs
  • Comments
  • Content Languages
  • Data Attributes
  • Div Element
  • Doctypes
  • Embed
  • Forms
  • Global Attributes
  • Headings
  • HTML 5 Cache
  • HTML Event Attributes
  • IFrames
  • Image Maps
  • Images
  • Include JavaScript Code in HTML
  • Input Control Elements
  • Label Element
  • Linking Resources
  • Lists
  • Marking up computer code
    • Block with
       and 
                                          
    • Inline with
  • Marking-up Quotes
  • Media Elements
  • Meta Information
  • Navigation Bars
  • Output Element
  • Paragraphs
  • Progress Element
  • Sectioning Elements
  • Selection Menu Controls
  • SVG
  • Tabindex
  • Tables
  • Text Formatting
  • Using HTML with CSS
  • Void Elements


HTML

  • Getting started with HTML
  • Upscaling your web development business
  • What Kind of Hosting Should a Student Choose?
  • Awesome Book
  • Awesome Community
  • Awesome Course
  • Awesome Tutorial
  • Awesome YouTube
  • Anchors and Hyperlinks
  • ARIA
  • Canvas
  • Character Entities
  • Classes and IDs
  • Comments
  • Content Languages
  • Data Attributes
  • Div Element
  • Doctypes
  • Embed
  • Forms
  • Global Attributes
  • Headings
  • HTML 5 Cache
  • HTML Event Attributes
  • IFrames
  • Image Maps
  • Images
  • Include JavaScript Code in HTML
  • Input Control Elements
  • Label Element
  • Linking Resources
  • Lists
  • Marking up computer code
    • Block with
       and 
                                      
    • Inline with
  • Marking-up Quotes
  • Media Elements
  • Meta Information
  • Navigation Bars
  • Output Element
  • Paragraphs
  • Progress Element
  • Sectioning Elements
  • Selection Menu Controls
  • SVG
  • Tabindex
  • Tables
  • Text Formatting
  • Using HTML with CSS
  • Void Elements

HTML Marking up computer code


Syntax

  • <pre>Formatted text</pre>
  • <code>Inline Code</code>

Remarks

The code element should be used for any kind of "string that a computer would recognize" (HTML5), for example:

  • source code
  • terms from markup/programming languages (element names, function names, etc.)
  • file names

Related elements

For variables, the var element can be used.

For computer output, the samp element can be used.

For user input, the kbd element can be used.

Marking up computer code Related Examples

  • Block with
     and  
                                        
  • Inline with



pdf PDF - Download HTML for free


Previous Next






This modified text is an extract of the original Stack Overflow Documentation created by following contributors and released under CC BY-SA 3.0
This website is not affiliated with Stack Overflow

logo rip
SUPPORT & PARTNERS
  • Advertise with us
  • Contact us
  • Privacy Policy
STAY CONNECTED

Get monthly updates about new articles, cheatsheets, and tricks.