The HTML Elements reference.

"code" - html element

  • This element shows text that is intended to be shown in a monospaced font.
  • This is useful for programming code.
  • Starttag <code> is Required and endtag </code> is Required
  • You can suggest another rendering using style sheets (CSS 'font' ).
  • Browsers that support the code - element : Internet Explorer Mozilla Firefox Opera Google Chrome Apple Safari
Element "code" example:
<title>Logical Styles</title>
<em>Emphasis</em> looks <i>italic</i>. <br>
<strong>Strong</strong> looks <b>bold</b>. <br>
<code>Code</code> looks like <tt>teletype</tt>. <br>
<samp>Sample</samp> looks like <tt>teletype</tt> too. <br>
<kbd>Keyboard</kbd> also looks like <tt>teletype</tt>. <br>
<var>Variable</var> looks <i>italic</i>. <br>
<dfn>Definition</dfn> also looks <i>italic</i>. <br>
<cite>Cite</cite> is another logical style that looks

Another element "code" example:
<PRE><CODE>// Code element example with no use of attributes
class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World!");

class , dir , id , lang , style , title

Attribute "class" value(s): A list of style class names that must be separated by white space characters.
  • This attribute assigns a style class name or set of style class names to an element. Any number of elements may be assigned the same class name or names.
  • You will find more about this in the CSS learning on this site.

© 2010 by Finnesand Data. All rights reserved.
This site aims to provide FREE programming training and technics.
Finnesand Data as site owner gives no warranty for the correctness in the pages or source codes.
The risk of using this web-site pages or any program codes from this website is entirely at the individual user.