Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

Html code tag code learning guide 2012 Donate at flattr Flattr this





Alert! Connect with 10,000 Chating Online. Join Now

Html code


Learn html code codes and tags using the sample below.

Html code

CODE
<KBD>Keyboard Input</KBD>



<CODE>Program Code</CODE>



<VAR>A Program Variable</VAR>



<SAMP>Sample Program Output</SAMP>

Generally, VAR is rendered in italics, the others are rendered in a monospace, pre-formatted typeface.

Example Usage

Note that all < and > symbols between tags must use their HTML &entity; format to be displayed on the page.

CODE

  <H1>JavaScript Example</H1>

  <P>In this example, a user types in their

  <KBD>FirstName LastName</KBD>, and the JavaScript below

  writes it into the page like this:



  <P><SAMP>Hello, FirstName LastName!</SAMP>



  <P><CODE>

  &lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;<BR>

  &lt;!--<BR>

  function writeHello(<VAR>username</VAR>) {<BR>

  &nbsp;&nbsp;&nbsp;&nbsp;document.write("Hello, "

  + <VAR>username</VAR> + "!");<BR>

  }<BR>

  // --&gt;<BR>

  </SCRIPT></CODE>

BROWSER

JavaScript Example

In this example, a user types in their FirstName LastName, and the JavaScript below writes it into the page like this:

Hello, FirstName LastName!

<SCRIPT LANGUAGE="JavaScript">
<!--
function writeHello(username) {
    document.write("Hello, " + username + "!");
}
// -->
</SCRIPT>

Same Example With Style Sheets

The distinction between them can be made better through the use of style sheets. (The source code has been color-coded to help you see what's going on a little better.)

CODE

<HEAD>

  <STYLE TYPE="text/css">

      KBD {

          background-color: #FFFF00;

      }

      SAMP {

          color: #000066;

          border: thin solid #006699;

          padding: 3px;

          margin: 2px;

      }

      CODE {

          color: #006600;

      }

      VAR {

          color: #FF0000;

      }

  </STYLE>

</HEAD>

<BODY>

  <H1>Same Example With Style Sheets</H1>

  <P>In this example, a user types in their

  <KBD>FirstName LastName</KBD>, and the JavaScript below

  writes it into the page like this:



  <P><SAMP>Hello, FirstName LastName!</SAMP>



  <P><CODE>

  &lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&gt;<BR>

  &lt;!--<BR>

  function writeHello(<VAR>username</VAR>) {<BR>

  &nbsp;&nbsp;&nbsp;&nbsp;document.write("Hello, "

  + <VAR>username</VAR> + "!");<BR>

  }<BR>

  // --&gt;<BR>

  </SCRIPT></CODE>

</BODY>

BROWSER

Same Example With Style Sheets

In this example, a user types in their FirstName LastName, and the JavaScript below writes it into the page like this:

Hello, FirstName LastName!

<SCRIPT LANGUAGE="JavaScript">
<!--
function writeHello(username) {
    document.write("Hello, " + username + "!");
}
// -->
</SCRIPT>


Html code source code

 

Html code tutorial

Html code code on this is provided for your study purpose, it will guide you to know how create and design a website using html. use it to practice and train your self online

All the tutorials on this site are free, the page code is provifed for you to use it to practice, if you want to help to improve and maintain this work, you can donate to us on.



Html tutorial guide and web design in easy steps


Beginners guide to html

Html tag

dl

ssi

meta

insdel

bdo

fieldset

q

ascii

code

textformat

ul

image

ol

paragraph

form

address

checkbox

blockquote

css

abbracro

anchor

divspan

object

table

nobr

All the tutorials on this site are provided for free. You can copy and print the tutorials and code on this site, but you are not allowed to reproduce this information on another website. All rights reserverd 2012
 

Css Generator    Htaccess Generator    Percentage Calculator   Area conversion

Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online