0% found this document useful (0 votes)
6 views12 pages

HTML and XML Formatting Examples

The document contains multiple HTML and XML sample programs demonstrating various HTML tags and attributes, including formatting, lists, tables, images, and hyperlinks. Each sample program showcases different aspects of HTML coding, such as text formatting, creating lists, displaying images, and structuring tables. Additionally, there are examples of XML structure for employee details with attributes and elements.

Uploaded by

abhigh212
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views12 pages

HTML and XML Formatting Examples

The document contains multiple HTML and XML sample programs demonstrating various HTML tags and attributes, including formatting, lists, tables, images, and hyperlinks. Each sample program showcases different aspects of HTML coding, such as text formatting, creating lists, displaying images, and structuring tables. Additionally, there are examples of XML structure for employee details with attributes and elements.

Uploaded by

abhigh212
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

<html>

<head>
<title>sample program1</title>
</head>
<body bgcolor="pink" text="blue">
<b>welcome </b> to the world of <i>html
programming.</i><br>
<u>we are learning some formatting tags</u><br>
<h1>this is for heading 1</h1><br>
<h6>this is for heading 6</h6><br>
<p>
this is the paragraph tag
</p>
<!--- this is used to write comments-->
</body>
</html>
<html>
<head>
<title>sample program2</title>
</head>
<body bgcolor="blue" text="white">
<center><font face="algerian" size=14 color= "red">
this text becomes 14 in size, red in color and algerian in
font face
</font></center>
<!--- this program is used to set font-->
</body>
</html>
<html>
<head>
<title>sample program3</title>
</head>
<body bgcolor="black" text="white">
<hr size=50% color="white" width=2 align="center">
<!--- this will display horizontal ruler having following
attributes-->
<em> this emphasis the text</em><br>
<strong> this strongly emphasis the text</strong>

</html>
<html>
<head>
<title>sample program4</title>
</head>
<body bgcolor="red" text="black">
<!--- this program will display ordered and unordered list--
>
<ol type= "A">house names
<li> mars house
<li>neptune house
<li> saturn house
<li> jupiter house
</ol>
<ul type= "disc">house names in unordered list
<li> mars house
<li>neptune house
<li> saturn house
<li> jupiter house
</ul>
</html>
<html>
<head>
<title>sample program5</title>
</head>
<body bgcolor="blue" text="white">
10<sup>th</sup> class<br>
h<sub>2</sub>o<br>
<pre>
roll no name
1 annand
2 amit
3 buland
</pre>
</body>
</html>
<html>
<head>
<title>sample program6</title>
</head>
<body bgcolor="white" text="blue">

<img src="C:\Users\Public\Pictures\Sample Pictures\


[Link]" alt="flower" vspace=40 hspace=30
height=500 width=400 border=3>
<!--- this program is used to display an inline image-->
</body>
</html>
<html>
<head>
<title>sample program7</title>
</head>
<body bgcolor="orange" text="black" link-"blue"
alink="red" vlink="purple">

<!---external hyperlinking -->


<A href="[Link]" >second page</a>

<!--- hyperimage-->
<A href=" [Link]"><img src="C:\Users\Public\
Pictures\Sample Pictures\[Link]"
alt="flower" vspace=40 hspace=30 height=500 width=400
border=3></a>

</body>
</html>
<html><head><title>sample program8</title></head>
<body bgcolor="white" text="black">
<!--- this displays a table with colspan-->
<table border= 2 bgcolor= "orange" cellspacing= 5
cellpadding=10>
<tr>
<th> Roll no</th>
<th> Name</th>
<th colspan >Phone nos</th>
</tr>
<tr>
<td> 1</td>
<td> amit</td>
<td> 9987654321</td>
<td> 8867098760</td
</tr>
<tr>
<td> 2</td>
<td> Babita</td>
<td> 7657849300</td>
<td> 5678493022</td
</tr>
</table>
<!--- this displays a table with rowspan-->
<table border= 1 bgcolor= "red" cellspacing= 5
cellpadding=10>
<tr>
<th> Roll no</th>
<th> Name</th>
<th >House Name</th>
</tr>
<tr>
<td> 1</td>
<td> amit</td>
<td rowspan=2> mars house</td>
</tr>
<tr>
<td> 2</td>
<td> Babita</td>
</tr>
</table></body>
</html>
<?xml version="1.0">
<employee>
<head>
<title>
employee details
</title>
</head>
<body>
<details name="Alisa Ray"
address=" rohini,new delhi"
date of joining="09/08/98"
mobile="9878690564"
designation="manager"
email="[Link]">
this is an example of showing sample data using attributes
</details>
</body>
</employee>
<?xml version="1.0">
<employee>
<head>
<title>
employee details
</title>
</head>
<body>
<details>
< name>Name: "Alisa Ray"</name>
<address>Address: " rohini,new delhi"</address>
<date of joining>date of joining: "09/08/98"</date of
joining>
<phone>
<mobile>mobile: "9878690564" </mobile>
</phone>
<designation>designation:"manager"</designation>
<email>email:"[Link]"</ email>
</details>
</body>
</emplyee>

You might also like