WTP Practical GAURAV & PRATIK
WTP Practical GAURAV & PRATIK
1. HTML Basics: Create a simple HTML document with headings, paragraphs, lists, links, images, and
tables.
Program:-
<!DOCTYPE html>
<html>
<head>
<body>
<h3>Unordered List</h3>
<ul>
<li>C.LANG</li>
<li>JAVA</li>
<li>WTP</li>
</ul>
<h3>Ordered List</h3>
<ol>
<li>Learn C.LANG</li>
<li>Learn JAVA</li>
<li>Learn WTP</li>
</ol>
<h3>Links</h3>
<p>Visit <a href="https://www.gtu.ac.in" target="_blank">GTU</a> to learn more about Study.</p>
<h3>Images</h3>
<img src="D:\MCA\sallogo.jpg" alt="Placeholder Image" width="150" height="150">
<h3>Table</h3>
<table border="1">
<tr>
<th>Language</th>
<th>Difficulty</th>
</tr>
<tr>
<td>WTP</td>
<td>Easy</td>
</tr>
1
( WTP PRACTICAL ASSIGNMENT ) | GAURAV & PRATIK
<tr>
<td>C.LANG</td>
<td>Moderate</td>
</tr>
<tr>
<td>JAVA</td>
<td>Challenging</td>
</tr>
</table>
</body>
</html>
OUTPUT :-
2
( WTP PRACTICAL ASSIGNMENT ) | GAURAV & PRATIK
2. HTML Forms: Design a form with various input types and validate it using HTML5 attributes.
Program:-
<!DOCTYPE html>
<html>
<head>
<body>
<h1>Registration Form</h1>
<label for="email">Email:</label>
<input type="email" id="email" name="email" placeholder="Enter your email" required>
<br><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password" placeholder="Enter your password"
required minlength="8">
<br><br>
<label for="age">Age:</label>
<input type="number" id="age" name="age" required>
<br><br>
<label>Gender:</label>
<input type="radio" id="male" name="gender" value="male" required>
<label for="male">Male</label>
<input type="radio" id="female" name="gender" value="female" required>
<label for="female">Female</label>
<br><br>
<label for="CITY">City:</label>
<select id="city" name="city" required>
<option value="">Select your city</option>
<option value="usa">AHEMDABAD</option>
<option value="uk">SURENDRANAGR</option>
<option value="india">RAJKOT</option>
3
( WTP PRACTICAL ASSIGNMENT ) | GAURAV & PRATIK
</select>
<br><br>
<button type="submit">Submit</button>
</form>
</body>
</html>
OUTPUT :-
4
( WTP PRACTICAL ASSIGNMENT ) | GAURAV & PRATIK
3. CSS Styling: Apply CSS to an HTML document to style text, borders, backgrounds, and layouts
using the Box Model.
Program:-
<!DOCTYPE html>
<html>
<head>
header {
background-color: #333;
color: white;
text-align: center;
padding: 20px;
}
.content {
background-color: #e0e0e0;
padding: 20px;
margin: 20px;
border: 2px solid #ccc;
}
footer {
background-color: #333;
color: white;
text-align: center;
padding: 10px;
}
</style>
</head>
<body>
<header>
<h1>Simple Box Model Example</h1>
</header>
<div class="content">
<p>This is a simple paragraph with some padding, border, and margin.</p>
</div>
5
( WTP PRACTICAL ASSIGNMENT ) | GAURAV & PRATIK
<footer>
<p>Footer content here.</p>
</footer>
</body>
</html>
OUTPUT :-
6
( WTP PRACTICAL ASSIGNMENT ) | GAURAV & PRATIK
Program:-
<!DOCTYPE html>
<html>
<head>
<title>Colorful Responsive Design</title>
<style>
body {
font-family: 'Comic Sans MS', cursive, sans-serif;
margin: 0;
padding: 0;
background: linear-gradient(to right, #ff7e5f, #feb47b);
color: #333;
}
header {
background-color: #ff6f61;
color: #fff;
padding: 25px;
text-align: center;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}
header h1 {
font-size: 2.5em;
}
main {
padding: 20px;
text-align: center;
}
main p {
font-size: 1.5em;
background-color: #fff3b0;
padding: 15px;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
footer {
background-color: #6a0572;
color: #fff;
text-align: center;
padding: 15px;
position: absolute;
width: 100%;
bottom: 0;
}
7
( WTP PRACTICAL ASSIGNMENT ) | GAURAV & PRATIK
header {
background-color: #2193b0;
}
main p {
background-color: #b0f4ff;
}
footer {
background-color: #4b0082;
}
}
main p {
font-size: 1.2em;
padding: 10px;
}
footer {
padding: 10px;
}
body {
background: linear-gradient(to right, #ffafbd, #ffc3a0);
}
}
</style>
</head>
<body>
<header>
<h1>Colorful Responsive Webpage</h1>
</header>
<main>
<section class="content">
<p>Welcome to a vibrant and responsive webpage! Resize your browser to see the magic of media
queries.</p>
</section>
</main>
<footer>
<p>Footer Section with Style</p>
</footer>
8
( WTP PRACTICAL ASSIGNMENT ) | GAURAV & PRATIK
</body>
</html>
OUTPUT :-
9
( WTP PRACTICAL ASSIGNMENT ) | GAURAV & PRATIK
5. JavaScript Basics: Write a JavaScript script to perform basic arithmetic operations and manipulate
the DOM.
Program:-
<!DOCTYPE html>
<html>
<head>
<title>Simple Arithmetic Operations</title>
<script>
function calculate() {
const num1 = parseFloat(document.getElementById('num1').value);
const num2 = parseFloat(document.getElementById('num2').value);
document.getElementById('result').innerHTML = `
Sum: ${sum} <br>
Subtraction: ${sub} <br>
Multiplication: ${mul} <br>
Quotient: ${quotient}
`;
}
</script>
</head>
<body>
<h1>Arithmetic Operations</h1>
<div>
<label for="num1">Number 1: </label>
<input type="number" id="num1">
</div>
<div>
<label for="num2">Number 2: </label>
<input type="number" id="num2">
</div>
<button onclick="calculate()">Calculate</button>
<h2>Results:</h2>
<p id="result"></p>
</body>
</html>
10
( WTP PRACTICAL ASSIGNMENT ) | GAURAV & PRATIK
OUTPUT :-
11