Saturday 28 September 2013

Writing Code In Html Page By Using Code Tags & Variable Text In Html Using Var Tags

Writing Code In Html Page By Using <Code> Tags

Code is used for Computer Code Examples.  If you have an example of a program you need to place on a web page, enclose it between the <code> and </code> tags.  The Effect will be a fixed width font. The following is an example of the usage of this tag:

<html>
     <head>
          <title>Example of Formatting Text</title>
     </head>
     <body>
          <p>Example Program Code
<code>#!/usr/bin/perl</code></p>
     </body>
</html>
NOTE: If your web browser does not support some of these tags, you will not see the formatting effect.

Variable Text In Html Using <Var> Tags

Variable is typically used when an example is provided and a piece of the example should be replaced.  For instance "telnet filename" The effect is different in different browsers.  Typically values between the <var> and the </var> tag are shown as italicized text. The following is an example of the usage of this tag:

<html>
     <head>
          <title>Example of Formatting Text</title>
     </head>
     <body>
          <p>Telnet
<var>filename</var></p>
     </body>
</html>

No comments:

Post a Comment