Home Tutorial Html Html5 HTML5 code tag, Definition of <code>tag in html5

 
 

HTML5 code tag, Definition of <code>tag in html5
Posted on: September 6, 2010 at 12:00 AM
Here, we will introduce you about the use and implementation of the <code>tag in html document

HTML5 code tag, Definition of <code> tag in html5

Here, we will introduce you about the use and implementation of the <code> tag in html document. This tag is used for representing the programming code in to the html document in the font of computer code text. The text within the <code> tag is marked up with the surrounding.

The <code> tag represents the programming code and program outputs in the computer code font style in the html document. This tag have both start and end tag.

Declaration Syntax:

<code>Your Code Here</code>

Example: Codetag.html.

<!DOCTYPE html>
<html>
  <head>
     <title>Example of code tag</title>
  </head>
 <body>
  <b>This is the code tag Example:</b><br>
   <code> 
       <blockquote>
           String str=new String("Gyan");<br>
           System.out.println(str);
      </blockquote>
    </code>
 </body>
</html>

Output:

Download This Example:

 

Difference between HTML5 and HTML4.01

There is no difference with the html4 version and don't have any element specific attribute.

Related Tags for HTML5 code tag, Definition of <code>tag in html5:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.