Graphic: "Full Stack Web Development"
Graphic: "Full Stack Web Development"
DEHRADUN CAMPUS
TERM WORK
DEHRADUN CAMPUS
CERTIFICATE
Faculty In charge
STUDENT LAB REPORT SHEET
2 Practical 2
3 Practical 3
4 Practical 4
5 Practical 5
6 Practical 6
7 Practical 7
8 Practical 8
9 Practical 9
10 Practical 10
11 Practical 11
12 Practical 12
13 Practical 13
14 Practical 14
S.No. Practical D.O.P. Date of Grad Grade Total Student’s Teacher’s
Submis e (Repor Marks Signature Signature
s ion (Viva t File) (out of
) 10)
15 Practical 15
16 Practical 16
17 Practical 17
18 Practical 18
19 Practical 19
20 Practical 20
21 Practical 21
22 Practical 22
23 Practical 23
24 Practical 24
25 Practical 25
26 Practical 26
27 Practical 27
28 Practical 28
29 Practical 29
30 Practical 30
31 Practical 31
32 Practical 32
33 Practical 33
34 Practical 34
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<pre>
*
* * *
* * * * *
* * * * * * *
</pre>
</body>
</html>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
table,
th,
td {
border: 1px solid black;
border-collapse: collapse;
}
img {
max-height: 30px;
}
</style>
</head>
<body>
<table>
<tr>
<th rowspan="2">Sr. No.</th>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>question_4</title>
<style>
body{
display: flex;
flex-direction: column;
}
h1{
text-align: center;
}
table,th,td {
border: 1px solid black;
}
img {
max-height: 100px;
}
</style>
</head>
<body>
<h1>Table With Mobile Connections</h1>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>question_5</title>
<style>
table{
position: relative;
}
h1{
text-align: center;
}
table,th,td {
border: 1px solid black;
left:40vh;
}
img {
max-height: 100px;
}
</style>
</head>
<body>
<h1>Table With Mobile Connections</h1>
<table>
<tr>
<td><a href="www.vodafone.com"><img src="IMAGES/vodaphone.jpg"
alt="vodaphone"></a></td>
<td><a href="www.microsoft.com"><img src="IMAGES/microsoft.jpg"
alt="microsoft"></a></td>
<td><a href="tata_indicom"><img src="IMAGES/tata_indicom.jpg" alt="tata
indicom"></a></td>
<td><a href="airtel.com"><img src="IMAGES/airtel.jpg" alt="airtel"></a></td>
</tr>
<tr>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.main_container {
position: absolute;
}
.container {
width: 953px;
position: relative;
border: 2px solid black;
display: flex;
justify-content: center;
}
.frame1 {
border: 2px solid black;
position: relative;
top: -2px;
height: 220px;
width: 250px;
}
.frame2 {
border: 2px solid black;
<body>
<div class="main_container">
<div class="container">
<p>Danish Ansari <br> Work Hard To Succeed</p>
</div>
<iframe class="frame1" src="question6_links.html">
<< /p>
</iframe>
<iframe class="frame2" src="" frameborder="0"></iframe>
<iframe class="frame3" src="" frameborder="0"></iframe>
</div>
</body>
</html>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
div {
position: relative;
margin: auto;
background-color: rgb(156, 156, 247);
height: 450px;
width: 500px;
}
#sec1{
position: relative;
top: 10px;
margin: 10px 10px;
padding-left: 20px;
border: 1px solid black;
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.form-container {
width: 400px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ccc;
text-align: left;
}
label {
display: inline-block;
margin-bottom: 10px;
}
input[type="text"], select {
width: 100%;
padding: 5px;
margin-bottom: 10px;
}
</style>
</head>
<body>
<div class="form-container">
<h2>Customer Profile</h2>
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
<label for="address">Address:</label>
<input type="text" id="address" name="address" required>
<label for="age">Age:</label>
<input type="text" id="age" name="age" required>
<button type="submit">Submit</button>
</form>
</div>
</body>
</html>
Output:
Source Code:
<video controls>
<source src="video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<audio controls>
<source src="audio.mp3" type="audio/mpeg">
Your browser does not support the audio tag.
</audio>
<header>
<h1>My Website</h1>
<nav>
<a href="/">Home</a>
<a href="/about">About</a>
<a href="/contact">Contact</a>
</nav>
</header>
<footer>
© 2024 My Company
</footer>
<nav>
<a href="/">Home</a>
<a href="/products">Products</a>
<a href="/contact">Contact</a>
</nav>
<input list="fruits">
<datalist id="fruits">
<option value="Apple">
<option value="Banana">
<option value="Orange">
</datalist>
<form>
<label for="username">Username:</label>
<input type="text" id="username" name="username">
<br>
<keygen name="userkey">
<br>
<input type="submit" value="Submit">
</form>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
a{
color: pink;
text-decoration: none;
}
a:hover {
color: blue;
}
a:visited {
color: green;
}
</style>
</head>
<body>
<h1>My Hyperlinks</h1>
<p>
<a href="https://example.com">Visit Example</a>
</p>
<p>
<a href="https://google.com">Explore Google</a>
</p>
<p>
<a href="https://bing.com">Search with Bing</a>
</p>
</body>
</html>
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* Box Shadow Example */
.box-shadow-example {
width: 200px;
height: 100px;
background-color: #f0f0f0;
margin: 20px;
padding: 10px;
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
}
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.rounded-box {
width: 200px;
height: 150px;
background-color: #73AD21;
border-radius: 15px;
padding: 20px;
}
</style>
</head>
<body>
<div class="rounded-box">
This is a box with rounded corners.
</div>
</body>
</html>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Newspaper Layout</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
display: flex;
justify-content: space-between;
}
.column {
margin-right: 20px;
}
.article {
background-color: #f9f9f9;
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
</style>
</head>
<body>
<div class="container">
<div class="column">
<div class="article">
<h2>Breaking News</h2>
<p>famous rapper badshah talked about his controvery with honey singh on
graphest</p>
</div>
</div>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Style Transition</title>
<style>
.box {
width: 200px;
height: 200px;
background-color: #3498db;
color: #fff;
text-align: center;
line-height: 200px;
font-size: 16px;
transition: background-color 0.5s ease, transform 0.5s ease;
}
.box:hover {
background-color: #e74c3c;
transform: scale(1.1);
}
</style>
</head>
<body>
<div class="box">Hover me!</div>
</body>
</html>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fixed Background Image</title>
<style>
body {
margin: 0;
padding: 0;
background-image:
url("C:/Users/danis/Desktop/weblabwork/questions/HTML/IMAGES/google.jpg");
background-size: cover;
background-attachment: fixed; /* This ensures the background remains fixed */
font-family: Arial, sans-serif;
}
.content {
padding: 20px;
color: #fff;
text-align: center;
}
</style>
</head>
<body>
<div class="content">
<h1>Welcome to My Web Page</h1>
<p>This is some content that will scroll over the fixed background image.</p>
</div>
</body>
</html>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Horizontal Repeat Background Image</title>
<style>
body {
margin: 0;
padding: 0;
background: url('background.jpg') repeat-x top left;
font-family: Arial, sans-serif;
}
.content {
padding: 20px;
text-align: center;
color: olive;
}
</style>
</head>
<body>
<div class="content">
<h1>Welcome to My Website</h1>
<p>This is a simple webpage with a background image repeated horizontally.</p>
</div>
</body>
</html>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
h2{
text-align: center;
}
#description{
height: 20px;
background-color: aquamarine;
padding: 20px;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}
a{
cursor: pointer;
}
a:hover{
color: red;
}
a:visited{
color:purple;
}
a:active{
color: blue;
}
#link{
text-align: center;
margin: 20px;
font-size: 1.2rem;
}
#layer_1{
font-size: 40px;
color: blue;
z-index: -1;
<a href="#">Register</a>
</div>
<div id="layer_1">
<img src="background.jpg"/>
LAYER 1
</div>
<div id="layer_2">
<img src="img2.jpg" alt="" style="width: 28%;">
LAYER 2
</div>
</body>
</html>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Custom Web Page</title>
<link rel="stylesheet" href="styles9.css">
</head>
<body>
<div class="container">
<h1>Welcome to My Custom Web Page</h1>
<p>This is a paragraph with a different font style.</p>
<div class="box">
<p>This is a box with a background image.</p>
</div>
<a href="#" class="custom-link">Click me</a>
</div>
</body>
</html>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Credit Card Validator</title>
</head>
<body>
<form id="validatorForm">
<label for="cardNumber">Enter your credit card number:</label>
<input type="text" id="cardNumber" name="cardNumber" maxlength="16">
<button type="button" onclick="validateCreditCard()">Validate</button>
<div id="validationResult"></div>
</form>
<script>
function validateCreditCard() {
var cardNumber = document.getElementById('cardNumber').value.replace(/\s+/g, ''); //
Remove whitespaces
var cardType = null;
var isValid = false;
// Check if the input matches any of the card types and lengths
if (cardNumber.match(/^4[0-9]{12}(?:[0-9]{3})?$/)) {
cardType = "Visa";
isValid = true;
} else if (cardNumber.match(/^5[1-5][0-9]{14}$/)) {
</body>
</html>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form Validation</title>
<style>
body {
font-family: Arial, sans-serif;
}
form {
max-width: 400px;
margin: 0 auto;
}
input[type=text], input[type=email], input[type=password] {
width: 100%;
padding: 10px;
margin: 5px 0;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
input[type=submit] {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
width: 100%;
}
input[type=submit]:hover {
background-color: #45a049;
}
.error {
<h2>Form Validation</h2>
<label for="email">Email:</label>
<input type="email" id="email" name="email" placeholder="Your email">
<label for="password">Password:</label>
<input type="password" id="password" name="password" placeholder="Your password">
<script>
function validateForm() {
var name = document.getElementById('name').value.trim();
var email = document.getElementById('email').value.trim();
var password = document.getElementById('password').value.trim();
var error = false;
// Validate name
if (name === '') {
document.getElementById('name').classList.add('error');
error = true;
} else {
document.getElementById('name').classList.remove('error');
}
// Validate email
var emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!email.match(emailPattern)) {
document.getElementById('email').classList.add('error');
error = true;
} else {
document.getElementById('email').classList.remove('error');
// Validate password
if (password.length < 8) {
document.getElementById('password').classList.add('error');
error = true;
} else {
document.getElementById('password').classList.remove('error');
}
if (error) {
return false; // Prevent form submission
} else {
return true; // Allow form submission
}
}
</script>
</body>
</html>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Country-Capital Quiz</title>
</head>
<body>
<h2>Country-Capital Quiz</h2>
<div id="result"></div>
<script>
function validateAnswer() {
var selectedCountry = document.getElementById('country').value;
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple Calculator</title>
<style>
.calculator {
width: 250px;
margin: 50px auto;
border: 1px solid #ccc;
padding: 10px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.calculator input[type="text"] {
width: 100%;
margin-bottom: 10px;
padding: 10px;
font-size: 18px;
border: 1px solid #ccc;
border-radius: 5px;
box-sizing: border-box;
}
.calculator input[type="button"] {
width: 48%;
padding: 10px;
font-size: 18px;
border: none;
border-radius: 5px;
cursor: pointer;
box-sizing: border-box;
}
.calculator input[type="button"]:hover {
background-color: #f0f0f0;
}
.calculator input[type="button"].equals {
width: 100%;
}
</style>
<div class="calculator">
<input type="text" id="display" readonly>
<input type="button" value="7" onclick="addToDisplay('7')">
<input type="button" value="8" onclick="addToDisplay('8')">
<input type="button" value="9" onclick="addToDisplay('9')">
<input type="button" value="/" onclick="addToDisplay('/')">
<input type="button" value="4" onclick="addToDisplay('4')">
<input type="button" value="5" onclick="addToDisplay('5')">
<input type="button" value="6" onclick="addToDisplay('6')">
<input type="button" value="*" onclick="addToDisplay('*')">
<input type="button" value="1" onclick="addToDisplay('1')">
<input type="button" value="2" onclick="addToDisplay('2')">
<input type="button" value="3" onclick="addToDisplay('3')">
<input type="button" value="-" onclick="addToDisplay('-')">
<input type="button" value="0" onclick="addToDisplay('0')">
<input type="button" value="." onclick="addToDisplay('.')">
<input type="button" value="=" onclick="calculate()">
<input type="button" value="+" onclick="addToDisplay('+')">
<input type="button" value="C" onclick="clearDisplay()">
</div>
<script>
function addToDisplay(value) {
document.getElementById("display").value += value;
}
function calculate() {
var result = eval(document.getElementById("display").value);
document.getElementById("display").value = result;
}
function clearDisplay() {
document.getElementById("display").value = "";
}
</script>
</body>
</html>
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Self-Modifying Web Page</title>
</head>
<body>
<script>
function updateContent() {
var currentTime = new Date();
var hours = currentTime.getHours();
var minutes = currentTime.getMinutes();
var seconds = currentTime.getSeconds();
</body>
</html>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Day of the Week Calculator</title>
</head>
<body>
<button onclick="calculateDayOfWeek()">Calculate</button>
<script>
function calculateDayOfWeek() {
var birthdate = document.getElementById('birthdate').value;
if (birthdate) {
var dateObject = new Date(birthdate);
var options = { weekday: 'long' };
var dayOfWeek = new Intl.DateTimeFormat('en-US', options).format(dateObject);
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Telephone Number Splitter</title>
</head>
<body>
<button onclick="splitPhoneNumber()">Split</button>
<script>
function splitPhoneNumber() {
var phoneNumber = document.getElementById('phoneNumber').value;
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Invert Filter on Mouseover</title>
<style>
img {
width: 300px;
transition: filter 0.5s;
}
</style>
</head>
<body>
<script>
function applyInvertFilter() {
document.getElementById('image').style.filter = 'invert(100%)';
}
function removeInvertFilter() {
document.getElementById('image').style.filter = 'none';
}
</script>
</body>
</html>
Output:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Status Bar Text Scroller</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<script>
// Function to scroll the text in the status bar
function scrollStatusBar() {
var text = "This is a scrolling message in the status bar. ";
var speed = 50; // Speed of scrolling (in milliseconds)
var pos = 0;
setInterval(function() {
// Append the first character to the end of the text
text = text.substring(1) + text.charAt(0);
// Increment position
pos++;
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Maruti Car Survey</title>
<style>
table {
border-collapse: collapse;
width: 100%;
}
th, td {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
th {
background-color: #f2f2f2;
}
</style>
</head>
<body>
<form id="surveyForm">
<div id="surveyResults"></div>
<script>
var surveyData = [];
function submitSurvey() {
var carModel = document.getElementById("carModel").value;
var city = document.getElementById("city").value;
updateSurveyResults();
}
function updateSurveyResults() {
var tableContent = "<h3>Survey Results</h3><table><tr><th>Maruti Car
Model</th><th>Metro City</th></tr>";
surveyData.forEach(function(item) {
tableContent += "<tr><td>" + item.carModel + "</td><td>" + item.city +
"</td></tr>";
});
tableContent += "</table>";
</body>
</html>
Output:
Source Code:
<?php
$cookie_name = 'user_preference';
$cookie_value = 'hello i am learning php and i am from graphic era';
setcookie($cookie_name, $cookie_value, time() + 15,"/");
if(!isset($_COOKIE[$cookie_name])) {
echo "Cookie named '" . $cookie_name . "' is not set!";
} else {
echo "Cookie '" . $cookie_name . "' is set!<br>";
echo "Value is: " . $_COOKIE[$cookie_name];
}
?>
Output:
Q32. Create a class component that maintains a counter and provides buttons to
increment and decrement the counter.
Source Code:
increment = () => {
this.setState({ count: this.state.count + 1 });
};
decrement = () => {
this.setState({ count: this.state.count - 1 });
};
render() {
return (
<div>
<h1>Counter: {this.state.count}</h1>
<button onClick={this.increment}>Increment</button>
<button onClick={this.decrement}>Decrement</button>
</div>
);
}
}
export default Counter;
Output:
Q33. Create a component with a form that updates the state based on user input.
Source Code:
import React, { Component } from 'react';
render() {
return (
<div>
<h2>User Form</h2>
<form onSubmit={this.handleSubmit}>
<div>
<label htmlFor="firstName">First Name:</label>
<input
type="text"
id="firstName"
name="firstName"
value={this.state.firstName}
onChange={this.handleInputChange}
/>
</div>
<div>
<label htmlFor="lastName">Last Name:</label>
Source Code:
//App.js
//home.jsx
import React from 'react';
//about.jsx
import React from 'react';
//contact.jsx
import React from 'react';