4. Basic HTML Example Programs for Heading,Horizontal Line,Paragraph and Hyperlink

Hyperlink Example

Syntax:

<a href="http://www.url.com">Text</a>

Code:

<html>

<body>

<p>HTML Link Example - www.thiyagaraaj.com</p>

<a href="http://www.thiyagaraaj.com">

This is a link for little drops @ thiyagaraaj.com</a>

</body>

</html>

Sample Output:

HTML Link Example - www.thiyagaraaj.com

This is a link for little drops @ thiyagaraaj.com

 

Paragraph Example

Syntax:

<p>text</p>

Code:

<html>

<body>

<p>Paragraph Example - www.thiyagaraaj.com</p>

<p>This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.</p>

</body>

</html>

Sample Output:

Paragraph Example - www.thiyagaraaj.com

This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.This is a paragraph.

Horizontal Line Example

Syntax:

<hr />

Code:

<html>

<body>

<p>HTML Horizontal Line Example - www.thiyagaraaj.com</p>

<hr />

<p>Normal Horizontal Line</p>

<hr size=10/>

<p>You can set size for Horizontal Line</p>

<hr size=10 color="grean"/>

<p>You can set Color for Horizontal Line</p>

</body>

</html>

Sample Output:

HTML Horizontal Line Example - www.thiyagaraaj.com

Normal Horizontal Line

You can set size for Horizontal Line

You can set Color for Horizontal Line

HTML Heading Example

Syntax:

<h1></h1>

<h2></h1>

<h3></h1>

<h4></h1>

<h5></h1>

<h6></h1>

Code:

<html>

<body>

<h1>Heading 1 Example</h1>

<p>Paragraph Example - www.thiyagaraaj.com</p>

<h2>Heading 2 Example</h2>

<p>Paragraph Example - www.thiyagaraaj.com</p>

<h3>Heading 3 Example</h3>

<p>Paragraph Example - www.thiyagaraaj.com</p>

<h4>Heading 4 Example</h4>

<p>Paragraph Example - www.thiyagaraaj.com</p>

<h5>Heading 5 Example</h5>

<p>Paragraph Example - www.thiyagaraaj.com</p>

<h6>Heading 6 Example</h6>

<p>Paragraph Example - www.thiyagaraaj.com</p>

</body>

</html>

Sample Output: