HTML <code> Tag
You can use <code>p {color:green}</code> to change the text color to green.
The <code>
element represents a fragment of computer code. Examples of computer code include an HTML or XML element name, a filename, a computer program, or any other string that a computer would recognize.
Most browsers display the contents of the <code>
element in a monospaced font (such as Courier) but you can always use style sheets to change this.
The <code>
element provides no means for formally specifying the language used. However, you can use the class
attribute with a value that is prefixed with language-
. For example, language-markup
, language-css
or language-javascript
.