Wednesday, June 1, 2011

HTML: Publishing HTML Source Code on Web Page


If you want to publish HTML source code on webpage you need to take some step on the program.

Example Program
<html>
<head>
                <title>HTML Source code on web page</title>
</head>

<body>

If you want to create a web page, just open any text editor and write the following HTML code
                <p>&lt;html>
                <br>&lt;head>
                <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title>html&lt;/title>
                <br>&lt;/head>
                <br>&lt;body>
                <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is my first HTML program.
                <br>&lt;/body>
                <br>&lt;/html>
</body>
</html>

Result



















Language Selection on Web Page

To define the language for a web page, lang attribute is used with <html> tag. The code name of a language is used with lang attribute. Such as for English the code is En and within the HTML program –
<html lang=”En”>
It can be writing within the document also. Such as –
<p lang=”En”>
dir attribute is another attribute that is used like as lang attribute.  dir attribute is two types –
dir=ltr
For this attribute the direction of the text will be from left to right. Suct as English Language.
dir=rtl
For this attribute the direction of the text will be from right to left. Suct as Arabic Language.

Tuesday, May 3, 2011

HTML: List


Index Based List


Generally the index based list is two types –


1.      Numbered or Ordered

2.      Bulleted or Unordered


The following tags are used to those two types –


1.      <ol>

<ol> is the ordered list. This tag is used to keep any document like 1, 2, 3 format.


2.      <ul>

<ul> is unordered list. This tag is used to keep any document in bullets format.


3.      <li>

<li> is the list tag. This tag is used within the <ol> and <ul> tag.




Use of OL Tag


We can use <ol> tag to keep any document like 1, 2, 3 or A, B, C or i, ii, iii format. To do this we need to declare the type attribute within the <ol> tag.


Program


<html>

<head>

            <title>Planet List</title>

</head>



<body>

            <ol type="1">

            <li>Earth</li>

            <li>Saturn</li>

            <li>Pluto</li>

            </ol>

</body>

</html>



Result



















You can use A or roman i with the type attribute. If you want to create a list which starting value is 15, just write 15 with the attribute type and it will begin from 15.


Use of UL Tag


<ul> tag is used to create unordered list. The program writing procedure is same as <ol> tag. Here the bullete is used like as number. See the program –



Program


<html>

<head>

            <title>Planet List</title>

</head>



<body>

            <ul type=square>

            <li>Earth</li>

            <li>Saturn</li>

            <li>Pluto</li>

            </ul>

</body>

</html>



Result




















You can use the attribute value as square, circle, disk etc.


DD Tag


The meaning of <dd> tag is Identifies Definition. This tag create a space before first line of a paragraph. As a ending tag </dd> is not essential but if you want you can use it. See the program –


Program


<html>

<head>

            <title>List</title>

</head>



<body>

<dd>The web page is the document that is created by a Markup Language called HTML.

The web browser is used to read the HTML document and display them as a web page.

</body>

</html>




Result