HTML code

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

External

Internal

Overview

The <code> tag defines text as computer code in the document.

Rendering

The content inside is displayed in the browser's default monospace font. CSS can be used to modify the rendering of the <code> elements.

In-Line <style>

<html>
  <head>
    <style>
    code {
           font-family: Consolas,"menlo";
           color: lightslategray;
           padding: 1px;
           background-color: whitesmoke;
           border-color: LightSteelBlue;
           font-size: 77%;
    }
    </style>
  </head>
  <body>
  This is <code>code</code>.
  </body>
</html>

MediaWiki

In MediaWiki, the CSS can be declared in MediaWiki:Common.css.