0% found this document useful (0 votes)
50 views

HTML Lab File PDF

The document contains code for an experiment submitted by a student named Rachit Kumar to their professor Dr. Pramod Soni Kumar. The experiment involves writing HTML code to create a basic web page with various HTML tags and elements like headings, paragraphs, and tables. Subsequent experiments focus on additional HTML features like forms, CSS styling with borders and drop downs, and basic JavaScript examples including alerts, cookies, and error handling.

Uploaded by

Shivam Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

HTML Lab File PDF

The document contains code for an experiment submitted by a student named Rachit Kumar to their professor Dr. Pramod Soni Kumar. The experiment involves writing HTML code to create a basic web page with various HTML tags and elements like headings, paragraphs, and tables. Subsequent experiments focus on additional HTML features like forms, CSS styling with borders and drop downs, and basic JavaScript examples including alerts, cookies, and error handling.

Uploaded by

Shivam Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

GALGOTIAS UNIVERSITY

Sector 17A Yamuna Expressway, Greater Noida, Gautam


Buddha Nagar, Uttar Pradesh 201303

Academic year: 2021-2022


School of Computer Science and Engineering
Web Technologies PBL (MCAN1231)

Submitted by: Submitted to:


RACHIT KUMAR Dr. PRAMOD SONI KUMAR
21SCSE2030113 Assistant Professor
Semester 2, Section 2 SCSE Department
EXPERIMENT NO. -1 DATE –16-03-2022

Write HTML code to create a basic web page consisting of various HTML tags
Code:
<!DOCTYPE html>

<html>
<head>
<title>GAME WORLD </title>
</head>
<body>

<h1>WELCOME TO MY PAGE </h1>


<p>MY NAME IS PRASHANT KUMAR.</p>
<h2>IT IS A GAME REALTED PAGE </h2>
<p>WE WILL PROVIDE THE NEXT LEVEL GAME .</p>
<h3>NEW AND UPDATED GAME ARE AVAILABLE FOR FREE </h3>

<p>WE WILL REALLY ENJOY THIS PAGE.</p>


</body>
</html>

OUTPUT
EXPERIMENT NO. -2 DATE – 23-03-2022
Write an HTML code to design a page containing text, in form of paragraphs given
suitable heading style.
Code:
<html>

<head>
<title>PRASHANT KUMAR</title>
</head>
<body>
<p align=”Justify”>My name is Prashant kumar from Masters of Computer Application Second Year. Iam
from Bihar Patna.
<h1 style="font-size:5vw" align="center"><i><strong><u>William
Shakespeare</i></u></strong></h1></p>

William Shakespeare (bapt. 26 April 1564 – 23 April 1616)[a] was an English playwright, poet and actor.
He is widely regarded as the greatest writer in the English language and the world's greatest
dramatist.[2][3][4] He is often called England's national poet and the "Bard of Avon" (or simply "the
Bard").[5][b] His extant works, including collaborations, consist of some 39 plays,[c] 154 sonnets, three
long narrative poems, and a few other verses, some of uncertain authorship. His plays have been
translated into every major living language and are performed more often than those of any other
playwright.[7] His works continue to be studied and reinterpreted.</p> <p>Shakespeare was born and
raised in Stratford-upon-Avon, Warwickshire. At the age of 18, he married Anne Hathaway, with whom he
had three children: Susanna and twins Hamnet and Judith. Sometime between 1585 and 1592, he began a
successful career in London as an actor, writer, and part-owner of a playing company called the Lord
Chamberlain's Men, later known as the King's Men. At age 49 (around 1613), he appears to have retired
to Stratford, where he died three years later. Few records of Shakespeare's private life survive; this has
stimulated considerable speculation about such matters as his physical appearance, his sexuality, his
religious beliefs and whether the works attributed to him were written by others. </p>
</body>
</html>
OUTPUT-
EXPERIMENT – 3 DATE- 06-04-2022

Write an HTML code to Define a table .


Code-
<!DOCTYPE html>

<html>
<style>
table, th, td {
border:1px solid black;
}

</style>
<body>
<h2>A basic HTML table</h2>
<table style="width:100%">
<tr>

<th>Company</th>
<th>Cars</th>
<th>Model</th>
</tr>
<tr>

<td>BMW</td>
<td>Black Edition</td>
<td>Bmw 2x</td>
</tr>
<tr>

<td>Audi</td>
<td>Grey Edition</td>
<td>GLA 3004</td>
</tr>
</table>

</body>
</html>

OUTPUT-
EXPERIMENT -4 DATE- 04-05-2022
WRITE AN HTML CODE TO CREATE A FORM.
CODE-
<!DOCTYPE html>
<html>
<body>
<h2>HTML Forms</h2>
<form action="/action_page.php">
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="PRASHANT"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="KUMAR"><br><br>
<input type="submit" value="Submit">
</form>
<p>If you click the "Submit" button, the form-data will be sent to a page called
"/action_page.php".</p>
</body>
</html>
EXPERIMENT – 5 DATE- 16-05-2022

Write a code to create a Basic code in CSS


Code
<!DOCTYPE html>
<html>
<title>Prashant.CSS</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet">

<body>
<div class="w3-container">
<h2>Basic Table</h2>
<p>To create a basic table</p>
<table class="basic-table">

<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Belongs to</th>
</tr>

<tr>
<td>Prashant</td>
<td>Kumar</td>
<td>Bihar</td>
</tr>

<tr>
<td>Sonia</td>
<td>Kumari</td>
<td>UP</td>
</tr>
<tr>
<td>Satyam</td>

<td>Kr.jha</td>
<td>Delhi</td>
</tr>
</table>
</div>

</body>
</html>
Experiment- 6 Date- 30-05-2022

WRITE A CODE TO CREATE A BORDER IN CSS


CODE
<!DOCTYPE html>

<html>

<title>PRASHANT.CSS</title>

<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet">

<body>

<div class="w3-container">

<h2>Borders</h2>

<div class="w3-panel w3-border">

<p>THIS IS MY BORDER.</p>

</div>

<div class="w3-panel w3-border-left">

<p>I HAVE LEFT BORDER.</p>

</div>

<div class="w3-panel w3-border-right">

<p>I HAVE RIGHT BORDER.</p>

</div>

<div class="w3-panel w3-border-top w3-border-bottom">

<p>I HAVE TOP AND BOTTOM BORDER.</p>

</div>

</div>

</body>

</html>
EXPERIMENT- 7 DATE- 30-05-2022

WRITE A CODE TO CREATE CSS DROPDOWNS.


CODE
<!DOCTYPE html>

<html>

<title>PRASHANT.CSS</title>

<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">

<body>

<div class="w3-container">

<h2>Dropdown Button</h2>

<p>Move the mouse over the button to open the dropdown content.</p>

<div class="w3-dropdown-hover">

<button class="w3-button w3-black">TOUCH ME!</button>

<div class="w3-dropdown-content w3-bar-block w3-border">

<a href="#" class="w3-bar-item w3-button">BUTTON 1</a>

<a href="#" class="w3-bar-item w3-button">BUTTON 2</a>

<a href="#" class="w3-bar-item w3-button">BUTTON 3</a>

</div>

</div>

</div>

</body>

</html>
EXPERIMENT- 8 DATE- 31-05-2022

Write a code to show <head>...</head> section in javascript.

Code
<html>

<head>

<script type="text/javascript">

<!--

function sayHello() {

alert("Hello World")

//-->

</script>

</head>

<body>

<input type="button" onclick="sayHello()" value="Say Hello" />

</body>

</html>
EXPERIMENT – 9 DATE- 13-06-2022

WRITE A CODE TO IMPLEMENT COOKIE IN JAVASCRIPT.


CODE.
<html>

<head>

<script type = "text/javascript">

<!--

function WriteCookie()

var now = new Date();

now.setMonth( now.getMonth() + 1 );

cookievalue = escape(document.myform.customer.value) + ";"

document.cookie="name=" + cookievalue;

document.cookie = "expires=" + now.toUTCString() + ";"

document.write ("Setting Cookies : " + "name=" + cookievalue );

//-->

</script>

</head>

<body>

<form name = "myform" action = "">

Enter name: <input type = "text" name = "customer"/>

<input type = "button" value = "Set Cookie" onclick = "WriteCookie()"/>

</form>

</body>

</html>
EXPERIMENT – 10 DATE- 13-06-2022

WRITE A CODE TO IMPLMENT ERRORS & EXCEPTION HANDLING IN JAVASCRIPT.


CODE
<html>

<head>

<script type = "text/javascript">

<!--

function myFunc() {

var a = 100;

var b = 0;

try {

if ( b == 0 ) {

throw( "Divide by zero error." );

else {

var c = a / b;

catch ( e ) {

alert("Error: " + e );

//-->
</script>

</head>

<body>

<p>Click the following to see the result:</p>

<form>

<input type = "button" value = "Click Me" onclick = "myFunc();" />

</form>

</body>

</html>

You might also like