HTML
HTML
<html>
<head>
<title>About Myself</title>
<style>
body {
background-color: purple;
color: lightpink;
</style>
</head>
<body>
<h1>About Me</h1>
<h4>
<p>My name is Manisha Sharma.I am 20 years old.I live in Ludhiana.I am currently pursuing
Post Graduation Diploma in Computer Application at Khalsa [Link] favorite
hobby is Cooking.I love learning newthings every day.
My favorite colour is pink.</p>
</h4>
</body>
</html>
<html>
<head>
<title>Formatting Tags</title>
</head>
<body style="background-color:lightpink,TEXT-BLACK;">
<h1>Technology</h1>
<hr>
<p>
concepts.
<br>
</p></H2>
<BR>
<p><h4><b>Technology</b> is <i>interesting</i>.</p>
<h3>Underline-:</h3>
<h3>Highlight-:</h3>
<p><mark>Programming</mark> is important.</p>
<h3>Code-:</h3>
<p><code>print("Hello World")</code></p>
<p><q>Knowledge is power</q></p>
<blockquote>“technology is the visible engine driving the modren world.” — Edsger Dijkstra</blockquote>
<h3>Abbreviation & Citation-:</h3>
Basics</cite></p>
<hr>
</body>
</html>
WRITE A PROGRAM IN HTML TO OPEN
LINKED DOCUMENTS IN NEW
WINDOWS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Webpage</title>
</head>
<h1>INTRODUCTION TO LINK</h1>
<p>
Gucci was founded in Florence, Italy, in 1921 by Guccio Gucci, who had previously worked as a bellboy at
London’s Savoy Hotel, where he admired the refined luggage of the English elite. Inspired by this experience,
he returned to Italy and opened a small workshop crafting leather travel goods and luggage for wealthy clients.
Early designs were influenced by equestrian themes, reflecting Guccio’s appreciation for horse-riding gear. The
brand’s first commercially successful bags were made from woven hemp (canapa) during material shortages in
the 1930s.
</p>
<p>
</p>
</body>
</html>
WRITE A PROGRAM IN HTML TO LINK TO SPECIFIC
LOCATIONS WITH THE SAME WEBPAGE
<html>
<head>
<meta charset="UTF-8">
<style>
body {
color: #000000;
.big-link {
font-size: 2em;
font-weight: bold; }
.masala-title {
font-size: 2em;
font-weight: bold; }
.masala-text {
font-size: 1.2em; }
img {
margin: 10px;
width: 200px;
height: 300px; }
</style>
</head>
<body>
<div style="height:800px;"></div>
<p class="masala-text">
<b>The term "masala" originates from Hindi and broadly translates to “spice mix”.
flavor profile for a dish. Masalas are not just seasoning; they are considered the
essence of Indian cooking, often reflecting regional traditions, family recipes, and
cultural heritage. They can be used in powdered form or as a paste, depending on the
</p>
<!-- Images (make sure these files are in the same folder as your HTML file) -->
</body>
</html>
WRITE A PROGRAM IN HTML TO LINK TO SPOT ON A
DIFFERENT WEB PAGE WITHIN THE SAME WEBSITE.
<html>
<head>
<title>Webpage</title>
</head>
<body bgcolor="lightpink">
<h1>INTRODUCTION TO LINK</h1>
<p>Instagram is a social networking service that allows users to upload photos and short-form videos, edit
them with filters, organize content using hashtags, and tag locations. Users can share posts publicly or with
selected followers, browse content by tags or locations, like posts, and follow other users to see their
updates in a personal feed. It is available on iOS, Android, Windows, and the Web, supporting 33 languages.
</p>
<br><br>
<br><br><br><br>
<a
href="[Link]
f0907921d6d9fd5302418JmltdHM9MTc2OTkwNDAwMA&ptn=3&ver=2&hsh=4&fclid=1
302368d-4582-63bb-2fef-
242344846215&psq=gmail+&u=a1aHR0cHM6Ly9tYWlsLmdvb2dsZS5jb20vbWFpbA">Click here</a>
</body>
</html>
.
WRITE A PROGRAM IN HTML TO LINK TO SPOT ON
A DIFFERENT WEB PAGE ON OTHER WEBSITES
<html>
<head>
<meta charset="UTF-8">
<title>First Page</title>
<style>
body {
background-color: #CCFFFF;
text-align: center;
h1 {
font-weight: bold;
h2 {
color: #006600;
</style>
</head>
<body>
<h1>EARRINGS<h1/>
<h2>
Earrings have been worn by humans for thousands of years, with evidence dating back to the Neolithic
period and early civilizations such as Mesopotamia, Egypt, and Greece. Ötzi the Iceman, who lived over
5,000 years ago, had pierced ears, suggesting the use of earrings in prehistoric Europe.
</h2>
<br><br><br><br>
<!-- Place the image in the same folder as this HTML file -->
<br><br><br><br>
<button>More Content</button>
</a>
</body>
</html>
<head>
<meta charset="UTF-8">
<title>TYPES OF EARRINGS</title>
</head>
<body bgcolor="#CCFFFF">
<h1><b>TYPES OF NAILS</b></h1>
</body>
</html>
<head>
<meta charset="UTF-8">
<title>IMAGE FILES</title>
</head>
<body bgcolor="BLACK">
<h1>Who is Spider-Man</h1>
Spider-Man was created by writer-editor Stan Lee and artist Steve Ditko, first appearing in Amazing Fantasy
#15 in August 1962 during the Silver Age of Comic Books. Peter Parker, a teenage orphan raised by his Aunt
May and Uncle Ben in Queens, New York, gains superhuman strength, agility, reflexes, and a precognitive
"spider-sense" after being bitten by a radioactive spider.
</p>
<br><br>
</h2>
<br><br>
<img src="[Link]" height="300" width="300" alt="Spider-Man PNG">
<br><br>
</h2>
<br><br>
</body>
</html>
WRITE A PROGRAM IN HTML TO CREATE AN IMAGE
AS LINK
<html>
<head>
<meta charset="UTF-8">
<title>Image as a Link</title>
</head>
<body>
<h3>Image link</h3>
</a>
</body>
</html>
WRITE A PROGRAM IN HTML TO SHOW SIMPLE
MARQUE
<html>
<head>
<meta charset="UTF-8">
<title>MARQUEE</title>
</head>
<h1><u>MARQUEE</u></h1>
</marquee>
</body>
</html>
<head>
<meta charset="UTF-8">
<title>Cartoon Background</title>
<style>
body {
background-size: cover;
background-repeat: no-repeat;
margin: 0;
padding: 0;
</style>
</head>
<body>
</marquee>
</body>
</html>
WRITE A PROGRAM IN HTML TO SHOW ORDERED AND
UNORDERED LIST
<html >
<head>
<meta charset="UTF-8">
<title>TYPES OF LIST </title>
<style>
body {
background-color: #C8F4FD; /* lightpink background */
color: black; /* text color black */
font-family: Arial, sans-serif;
margin: 20px; }
h1 { text-align: center;}
h2 { margin-top: 20px; }
ol {margin-left: 25px;}
ul {
list-style-type: circle; /* circle bullets */
margin-left: 25px; }
dl { margin-left: 25px;}
dt { font-weight: bold;
margin-top: 10px;}
dd {margin-left: 20px;}
</style>
</head>
<body>
<h1>TYPES OF LISTS </h1>
<BR>
<hr HR style="color:red; background-color:BLACK; height:3px;">
<hr style="color:red; background-color:BLACK; height:2px;">
<!-- Ordered List -->
<h2> ORDERED LIST -: Steps of Making Momos</h2>
<ol type="1">
<li>Prepare the dough</li>
<li>Make the filling</li>
<li>Roll out the dough</li>
<li>Fill and shape the momos</li>
<li>Steam the momos</li>
<li>Serve hot with chutney</li>
</ol>
<hr style="color:red; background-color:BLACK; height:3px;">
<!-- Unordered List -->
<h2> UNORDERED LIST-: Fruits Names</h2>
<ul type="circle">
<li>Banana</li>
17
<li>Papaya</li>
<li>Litchi Fries</li>
<li>Orange</li>
<li>Mango</li>
</ul>
<hr style="color:black; background-color:red; height:3px;">
<!-- Definition List -->
<h2>DEFINITION LIST -: Water,Nytrogen,Hydrogen,Oxygen</h2>
<dl>
<dt>Water</dt>
<dd>
a colourless, transparent, odourless liquid that forms the seas, lakes, rivers, and rain and is the basis of
the fluids of living organism</dt>
<dt>Hydrogn</dt>
<dd>a colourless, odourless, highly flammable gas, the chemical element of atomic number.</dd>
<dt>Nytrogen</dt>
<dd>the chemical element of atomic number 7, a colourless, odourless unreactive gas that forms
about 78 per cent of the earth's atmosphere.</dd>
<dt>Oxygen (Low-Fat)</dt>
<dd>a colourless, odourless reactive gas, the chemical element of atomic number 8 and the life-
supporting component of the air.</dd>
</dl>
<hr style="color:black; background-color:red; height:3px;">
</body>
</html
WRITE A PROGRAM IN HTML TO SHOW
WORKING OF TABLE
<html >
<head>
<meta charset="UTF-8">
<title>Product Table Example</title>
<style>
table {
border-collapse: collapse;
width: 70%;
th, td {
padding: 11px;
text-align: center;
th {
background-color: lightpink;
</style>
</head>
<body bgcolor="lightpink">
<table>
<tr>
<th>Picture</th>
<th>Product Name</th>
<th>Details</th>
<th>Price</th>
</tr>
<!-- Product 1 -->
<tr>
<td><img src="C:\Users\DELL\Desktop\0d8cc88b2c034c94bdc604b07e0deb28_w540_h720_q85.jpg"
alt="Product 1" width="200" height="200"></td>
<td>
<table>
<tr><td>Color: Red</td></tr>
<tr><td>Size: Medium</td></tr>
<tr><td>Stock: Available</td></tr>
</table>
</td>
<td>$800</td>
</tr>
<tr>
<td><b>A-Line Dress</b></td>
<td>
<table>
<tr><td>Color: Pink</td></tr>
<tr><td>Size: Large</td></tr>
</table>
</td>
<td>$700</td>
</tr>
<!-- Product 3 -->
<tr>
<title>nested table</title>
</head>
<body bgcolor="#LIGHTPINK"text="purple">
<h1>Nested table</h1>
cellspacing="5"
cellpadding="5"><caption><b>Nested Tble</b></caption>
<tr>
<th>name</th>
<th>job</th>
<th>salary</th>
</tr>
<tr>
<td>MANISHA SHARMA</td>
<td>
<tr>
<td>President</td>
<td>Vice President</td>
</tr>
<tr>
<td>Manager</td>
<td>Gen Manager</td>
</tr>
</table>
</td>
<td>45000</td>
</bo
</tr>
<tr>
<td>PREET</td>
<td>executive</td>
<td>87O00</td>
</tr>
<td>PRACHI</td>
<td>salesman</td>
<td>15008</td>
</tr>
</table>
</body>
</html>
WRITE A PROGRAM IN HTML TO SHOW FRAMESET
<html>
<head>
<meta charset="UTF-8">
<title>Frames in HTML</title>
</head>
</frameset>
<noframes>
<body>
</body>
</noframes>
</html>
WRITE A PROGRAM IN HTML TO SHOW HORIZONTAL
FRAMESET
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Frames Example</title>
</head>
<frame src="[Link]">
</frameset>
<noframes>
<body>
<p>This page requires a browser that supports frames.</p>
</body>
</noframes>
</html>
LOOPING STATEMENTS
PROGRAM TO SHOW WHILE LOOP STATEMENT IN
JAVASCRIPT LOOPING STATEMENT
<HTML>
<HEAD>
<TITLE>LOOPING STATEMENTS</TITLE>
<SCRIPT TYPE="TEXT/JAVASCRIPT">
var i = 0;
while(i <= 5)
[Link]("<br>");
i++; }
</SCRIPT>
</HEAD>
<BODY>
<H2>Success..!!</H2>
</BODY>
</HTML>
<HEAD>
<TITLE>LOOPING STATEMENTS</TITLE>
<SCRIPT TYPE="TEXT/JAVASCRIPT">
var i = 0;
do
{
[Link]("The number is " + i);
[Link]("<br>");
i++;
36
</SCRIPT>
</HEAD>
<BODY>
<H2>Success..!!</H2>
</BODY>
</HTML>
<HEAD>
<TITLE>LOOPING STATEMENTS</TITLE>
<SCRIPT TYPE="TEXT/JAVASCRIPT">
var i = 0;
if (i == 3)
{ break; }
[Link]("<br>");
</SCRIPT>
</HEAD>
<BODY>
<H2>Success..!!</H2>
</BODY>
</HTML>
<HEAD>
<TITLE>LOOPING STATEMENTS</TITLE>
<SCRIPT TYPE="TEXT/JAVASCRIPT">
var x;
for (x in person)
{
[Link](person[x] + " ");
</SCRIPT>
</HEAD>
<BODY>
<H2>Success..!!</H2>
</BODY>
</HTml>
FUNCTIONS
PROGRAM TO SHOW ALERT()BUILT-IN FUNCTION IN
JAVASCRIPT
<HTML>
<HEAD>
<TITLE>ALERT BOX</TITLE>
<SCRIPT TYPE="TEXT/JAVASCRIPT">
function myFunction()
{
alert("This is an alert box!");
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>
<HEAD>
<TITLE>CONFIRM BOX</TITLE>
<SCRIPT TYPE="TEXT/JAVASCRIPT">
function show_confirm()
39
}}
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>
PROGRAM TO SHOW PROMT() BUIT-IN FUNCTION IN
JAVASCRIPT
<HTML>
<HEAD>
<TITLE>PROMPT BOX</TITLE>
<SCRIPT TYPE="TEXT/JAVASCRIPT">
function show_prompt()
{
var name = prompt("Please enter your name", "Harry Potter");
if (name != null && name != "")
{
[Link]("Hello " + name + "! How are you today?");
}
else
{
alert("Please enter some name");
}
}
</SCRIPT>
</HEAD>
<BODY>
<H2>Click the button to display a prompt box.</H2>
<BUTTON onclick="show_prompt()">Try it</BUTTON>
</BODY>
</HTML>
PROGRAM TO SHOW USER DEFINE FUNCTION IN JAVA
SCRIPT
<HTML>
<HEAD>
<TITLE>USER-DEFINED FUNCTIONS</TITLE>
<SCRIPT TYPE="TEXT/JAVASCRIPT">
function myFunction(name,job)
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>
<head>
<script type="text/javascript">
function arrayex()
{
myarray[0] = 10
myarray[1] = 20
myarray[2] = 30
myarray[3] = 40
myarray[4] = 50
sum = 0;
alert(sum);}
</script>
</head>
<body>
</body>
</html>
</body>
</html>
EVENT HEANDLING
PROGRAM TO SHOW ONCLICK EVENT TYPE IN
JAVASCRIPT EVENT HANDLING
<HTML>
<HEAD>
<TITLE>EVENT HANDLING</TITLE>
<SCRIPT TYPE="TEXT/JAVASCRIPT">
function sayHello(){
alert("Hello to Everyone.");}
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>
</BODY>
</HTML>
<HEAD>
<SCRIPT TYPE="TEXT/JAVASCRIPT">
function validateForm(){
var x=[Link];
if (x==null || x==""){
else
alert("Hello "+x);
44}
</SCRIPT>
</HEAD>
<BODY>
<PRE>
</PRE>
</FORM>
</BODY>
</HTML>
<HEAD>
<TITLE>EVENT HANDLING</TITLE>
<SCRIPT TYPE="TEXT/JAVASCRIPT"><!--
function over(){
alert("Mouse Over");}
function out(){
alert("Mouse Out");}
-->
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>
PROGRAM TO SHOW CLIENT SIDE FORM
VALIDIATION IN JAVASCRIPT
<HTML>
<HEAD>
<TITLE>FORM VALIDATION</TITLE>
<SCRIPT TYPE="TEXT/JAVASCRIPT">
function validateForm()
var x=[Link];
var y=[Link];
var atpos=[Link]("@");
var dotpos=[Link](".");
if (x==null || x=="")
else
alert("Hello "+x);
else
</SCRIPT>
</HEAD>
<BODY>
<PRE>
First Name: <INPUT type="text" name="fname"><BR><BR>
</PRE>
</FORM>
</BODY>
</HTML>
<HEAD>
<script type="text/javascript">
function bg(){
else{
</script>
</HEAD>
<BODY onload="bg()">
</BODY>
</HTML>
JAVASCRIPT OBJECTS
<body>
<script>
[Link](str);
</script>
</body>
</html>
<body>
<script>
[Link](stringname);
</script>
</body>
</html>
JAVASCRIPT STRING FUNCTIONS
<script>
[Link]([Link](4));
</script>
</body>
</html>
<body>
<script>
var s2 = "SHARMA";
var s3 = s1 + s2;
[Link](s3);
</script>
</body>
</html>
<body>
<script>
var n = [Link]("is");
[Link](n);
52
</script>
</body>
</html>
PROGRAM TO SHOW TOUPPERCASE() METHOD IN
JAVASCRIPT
<html>
<body>
<script>
var s2 = [Link]();
[Link](s2);
</script>
</body>
</html>
<body>
<script>
var s2 = [Link]();
[Link](s2);
</script>
</body>
</html>
PROGRAM TO SHOW LICE(beginIndex,endIndex)
METHOD IN JAVASCRIPT
<html>
<body>
<script>
var s1 = "fghijklmnh";
var s2 = [Link](2,5);
[Link](s2);
</script>
</body>
</html>
<body>
<script>
</script>
</body>
</html>
PROGRAM TO SHOW MATH METHODS IN
JAVASCRIPT
<html>
<body>
<script>
</script>
</body>
</html>
<body>
<script>
var dt = Date();
</body>
</html>
<body>
<script>
</script>
</body>
</html>
User defined functions
PROGRAM TO SHOW USER DEFINE FUNCTION IN
JAVASCRIPT
<HTML>
<HEAD>
<TITLE>User-defined Objects</TITLE>
<SCRIPT TYPE="TEXT/JAVASCRIPT">
function UserObj()
[Link] = "MANISHA";
[Link] = "SHARMA";
[Link] = 20;
[Link] = "BROWN";
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>
OBJECTS WITHIN OBJECTS
PROGRAM TO SHOW OBJECTS WITHIN OBJECTS IN
JAVASCRIPT
<html>
<body>
<script>
var user = {
name: "MANISHA",
age: 20,
size: {
top: 60,
middle: 90,
bottom: 60
</script>
</body>
</html>
PHP
EMBEDDING PHP CODE IN WEB PAGES
<html>
<head>
</head>
<body>
<?php
?>
</body>
</html
>
$number=1221;
if($number%2==0)
else
{
}
?>
?>
$num = 12345;
$sum = 0;
$bc = $num;
?>
PROGRAM IN PHP TO PRINT THE TABLE OF A GIVEN
NUMBER
<?php
define('a', 5);
echo $i * a;
echo '<br>';
?>
PROGRAM IN PHP TO PRINT FACTORIAL OF A GIVEN NUMBER
<?php
$num = 5;
$factorial = 1;
?>
if ($num % $i == 0) {
echo $i . "<br>";
?>
PROGRAM IN PHP TO PRINT THE TRIANGLE FORMAT
GIVENBELOW:
1
12
123
1234
12345
<?php
for($i=0;$i<=5;$i++){
for($j=1;$j<=$i;$j++){
echo $j;
echo"<br>";}
?>