Professional Documents
Culture Documents
Aditya Css10to15
Aditya Css10to15
Practical no:
13 Code:-
<!DOCTYPE html>
<html>
<head>
<title>Rollover Effect Example</title>
<style> .rollover {
width: 200px; height:
100px; background-color:
#2aa7fa; color: #fff;
text-align: center; line-
height: 100px;
transition: background-color 0.3s, color 0.3s;
}
.rollover:hover {
background-color: #e74c3c;
color: #000;
}
</style>
</head>
<body>
<h1>Rollover Effect Example</h1>
Output:-
Client Side Scripting(practical)
Name: ASHWIN PAWAR
Practical no:
14 Code:-
<!DOCTYPE html>
<html> <head>
<title>Menu Example</title>
<style>
/* Styles for the horizontal menu */
.horizontal-menu { display: flex;
list-style-type: none;
}
.horizontal-menu li {
margin-right: 10px;
}
.vertical-menu li { margin-
bottom: 10px;
}
</style>
Client Side Scripting(practical)
Name: ASHWIN PAWAR
</head>
<body>
<h1>Menu Example</h1>
<h2>Horizontal Menu</h2>
<ul class="horizontal-menu">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact</a></li>
</ul>
<h2>Vertical Menu</h2>
<ul class="vertical-menu">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact</a></li>
</ul>
</body>
</html>
Client Side Scripting(practical)
Name: ASHWIN PAWAR
Output:-
Client Side Scripting(practical)
Name: ASHWIN PAWAR
Practical no:
15 Code:-
<!DOCTYPE html>
<html>
<head>
<title>Protected Web Page</title>
<style> body {
user-select: none;
}
</style>
<script>
// Disable right-click on the webpage
window.addEventListener('contextmenu', function (e) {
e.preventDefault();
});
<body>
<h1>Welcome to the Protected Web Page</h1>
<p>Right-click and text selection have been disabled. A custom status message will appear in
the status bar.</p>
</body>
</html>
Output:-
Client Side Scripting(practical)
Name: ASHWIN PAWAR
Practical no:
12 Code:-
<!DOCTYPE html>
<html>
<head>
<title>Form Validation with Regular Expressions</title>
</head>
<body>
<h1>Form Validation with Regular Expressions</h1>
<form id="validationForm">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
<button type="submit">Submit</button>
</form>
<div id="validationResult"></div>
<script>
const form = document.getElementById("validationForm");
Client Side Scripting(practical)
Name: ASHWIN PAWAR
Output:-
Client Side Scripting(practical)
Name: ASHWIN PAWAR
Practical no:
11 Code:-
<!DOCTYPE html>
<html>
<head>
<title>Child Window Example</title>
</head>
<body>
<h1>Child Window Example</h1>
<script>
let childWindow = null;
function openChild() {
childWindow = window.open('', 'childWindow', 'width=400,height=400');
}
document.getElementById('openChildWindow').addEventListener('click', openChild);
document.getElementById('moveChildWindow').addEventListener('click', function() {
if (childWindow) {
document.getElementById('resizeChildWindow').addEventListener('click', function() {
if (childWindow) {
childWindow.resizeBy(50, 50); // Resize the child window by increasing both width and
height by 50 pixels.
}
});
</script>
</body>
</html>
Client Side Scripting(practical)
Name: ASHWIN PAWAR
Output:-
Client Side Scripting(practical)
Name: ASHWIN PAWAR
Practical no:
10 Code:-
<!DOCTYPE html>
<html>
<head>
<title>Cookie Example</title>
</head>
<body>
<h1>Cookie Example</h1>
<script>
// Function to set a session cookie
document.getElementById('setSessionCookie').addEventListener('click', function() {
document.cookie = "session_cookie=This is a session cookie; path=/"; alert("Session
cookie set");
});
Client Side Scripting(practical)
Name: ASHWIN PAWAR
// Function to set a persistent cookie (expires in 7 days)
document.getElementById('setPersistentCookie').addEventListener('click', function() {
const expirationDate = new Date();
expirationDate.setDate(expirationDate.getDate() + 7);
document.cookie = `persistent_cookie=This is a persistent cookie;
expires=${expirationDate.toUTCString()}; path=/`;
alert("Persistent cookie set");
});