Wednesday, November 13, 2013

Programming Variables in HTML

This element is usually used in conjunction with the <pre> and <code> elements to indicate that the content of that element is a variable that can be supplied by a user
<p><code>document.write("<var>user-name</var>")</code></p>

This will produce following result:
document.write("user-name")

Program Output
The <samp> element indicates sample output from a program, script, or the like. Again, it is mainly used when documenting programming concepts.

For example:
<p>Result produced by the program is <samp>Hello World</samp></p>

This will produce following result:
Result produced by the program is Hello World

Addresses
The <address> element is used to contain any address.

For example:
<address>1001, Nina Nagar, Hyderabad - INDIA, 500043</address>

This will produce following result:
1001, Nina Nagar, Hyderabad - INDIA, 500043

Block and Inline Elements:
We can categories all the elements into two sections:
Block-level elements: Block-level elements appear on the screen as if they have a carriage return or line break before and after them. For example the <p>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <ul>, <ol>, <dl>, <pre>, <hr />, <blockquote>, and <address> elements are all block level elements. They all start on their own new line, and anything that follows them appears on its own new line.

Inline elements: Inline elements, on the other hand, can appear within sentences and do not have to appear on a new line of their own. The <b>, <i>, <u>, <em>, <strong>, <sup>, <sub>, <big>, <small>, <li>, <ins>, <del>, <code>, <cite>, <dfn>, <kbd>, and <var> elements are all inline elements.

No comments:

Post a Comment