HTML code: Difference between revisions
Jump to navigation
Jump to search
(2 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
* [[HTML Tags]] | * [[HTML Tags]] | ||
=Overview= | =Overview= | ||
The <code> tag defines text as computer code in the document. | The <code><code></code> tag defines text as computer code in the document. | ||
=Rendering= | =Rendering= | ||
Line 16: | Line 16: | ||
<style> | <style> | ||
code { | code { | ||
font-family: Consolas,"menlo"; | |||
color: lightslategray; | |||
padding: 1px; | |||
background-color: whitesmoke; | |||
border-color: LightSteelBlue; | |||
font-size: 77%; | |||
} | } | ||
</style> | </style> | ||
Line 29: | Line 30: | ||
</html> | </html> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==MediaWiki== | |||
In MediaWiki, the CSS can be declared in [[Media_Wiki_Concepts#MediaWiki:Common.css|MediaWiki:Common.css]]. |
Latest revision as of 07:33, 30 April 2021
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.