HTML Program Examples
HTML Program Examples
Formatting Tags :
<Html>
<Head>
<title> Formatting tags </title>
</Head>
<body bgcolor=”pink” text=”blue” topmargin=”50” leftmargin=”50” >
<h1> HTML</h1>
< P align=”center” >
HTML stands for <font face=”Arial” size=”72” color=”red”> Hyper Text Mark-up Language
</font>. HTML is used to create web pages or it describes the structure of a web page. HTML is a
pre-defined programming language. It creates <b><i><u>Static web pages</b></i>,</u>, “Static”
means unchanged or constant. HTML documents are made up of two things i.e. “The content” and
“The Tags” HTML consists of a series of elements and the elements tell the browser how to display
the content.
</p>
</body>
</Html>
List Tags:
<HTML>
<HEAD>
<TITLE> LIST </TITLE>
</HEAD>
<BODY>
INPUT DEVICES:
<OL TYPE=”1”>
<Li> Mouse</Li>
<Li> Keyboard</Li>
<Li> Scanner</Li>
</OL>
</BODY>
</HTML>
Table tags:
<Html>
<Head>
<Title> table tag</Title>
</Head>
<Body>
<Center>
<Table border="5" width="30%">
<Caption align="top">
<H3>Salary Table</H3>
</Caption>
<Tr>
<Th colspan="2">Name</Th>
<Th rowspan="2">Month</Th>
<Th rowspan="2">Salary </Th>
</Tr>
<Tr>
<Th>first name</Th>
<Th>last name</Th>
</Tr>
<Tr>
<Td>Raj</Td>
<Td>Kumar</Td>
<Td>January</Td>
<Td>50000</Td>
</Tr>
<Tr>
<Td>Dinesh</Td>
<Td>Das</Td>
<Td>February</Td>
<Td>60000</Td>
</Tr>
</Table>
</Center>
</Body>
</Html>
Form tags:
<html>
<head>
<title>Form</title>
</head>
<body bgcolor="pink">
<form action=”login.php”>
UserID:<br>
<input type="text" name="username"><br>
Password:<br>
<input type="password" name="psw"><br>
First Name:<input type="text"><br> Last Name:<input type="text"><br>
Age: <select name=”age”>
<option value= ”18”>18 </option >
<option value= ”19”>19 </option >
<option value= ”20”>20 </option >
<option value= ”21”>21 </option >
<option value= ”22”>22 </option >
<option value= ”23”>23</option >
<option value= ”24”>24 </option >
<option value= ”25”>25 </option >
<option value= ”26”>26 </option >
<option value= ”27”>27 </option >
<option value= ”29”>29 </option >
<option value= ”30”>30 </option >
Gender:<br>
<input type="radio" name="gender" value="male">Male<br>
<input type="radio" name="gender" value="female">Female<br>
<input type="radio" name="gender" value="other">Other<br>
Language:<br>
<input type="checkbox" name="language1" value="c">C<br>
<input type="checkbox" name="language2" value="c++">C++<br>
<input type="checkbox" name="language3" value="java">Java<br>
<input type="checkbox" name="language4" value="html">HTML <br>
<input type="submit" value="submit">
<input type="reset" value="reset">
</form>
</body>
</html>
Frame Tags:
<html>
<head>
<title>HTML Target Frames</title>
</head>
<frameset cols = "40%,60%" frameborder="15" framespacing="50">
<frame src = "page.htm" Frameborder="10" Marginwidth="5" Marginheight="100" />
<frame name = "t1"/>
<frame name = "t1"/>
<noframes>
<body>Your browser does not support frames.</body>
</noframes>
</frameset>
</html>
Iframe :
<html>
<head>
<title>HTMLFrames</title>
</head>
<body>
<iframe src="https://www.nist.edu/academics/BTech_CSE.html">
</body>
</html>