ETE
ETE
<!DOCTYPE html>
<html>
<head>
<style>
/* Button Styles */
.button {
display: inline-block;
position: relative;
padding: 10px 20px;
font-size: 18px;
color: #ffffff;
text-transform: uppercase;
text-decoration: none;
border: none;
background-color: #4286f4;
overflow: hidden;
transition: all 0.3s ease;
}
.button::before,
.button::after {
content: "";
position: absolute;
width: 100%;
height: 2px;
background-color: #ffffff;
transition: all 0.3s ease;
}
.button::before {
top: 0;
}
.button::after {
bottom: 0;
}
/* Hover Effects */
.button:hover {
background-color: transparent;
color: #4286f4;
}
.button:hover::before,
.button:hover::after {
width: 0;
}
</style>
</head>
<body>
<a href="#" class="button">Hover Me</a>
</body>
</html>
.....................................................
Q39.
<!DOCTYPE html>
<html>
<head>
<style>
/* Slider Styles */
.slider {
width: 500px;
height: 300px;
overflow: hidden;
}
.slider img {
width: 100%;
height: auto;
transition: transform 0.5s ease;
}
</style>
</head>
<body>
<div class="slider">
<img src="1.jpg" alt="Image 1">
<img src="2.jpg" alt="Image 2">
<img src="3.jpg" alt="Image 3">
</div>
<script>
// JavaScript Code
const slider = document.querySelector('.slider');
const images = slider.getElementsByTagName('img');
let currentIndex = 0;
function showImage(index) {
for (let i = 0; i < images.length; i++) {
images[i].style.transform = `translateX(-${index * 100}%)`;
}
}
function nextImage() {
currentIndex = (currentIndex + 1) % images.length;
showImage(currentIndex);
}
.....................................................................
Q38.
<!DOCTYPE html>
<html>
<head>
<script>
function calculateAge() {
var birthdate = document.getElementById('birthdate').value;
var today = new Date();
var birthdateObj = new Date(birthdate);
............................................................................
Q37.
<!DOCTYPE html>
<html>
<head>
<style>
/* Progress Steps Styles */
.progress-container {
display: flex;
justify-content: space-between;
margin-bottom: 40px;
}
.step {
flex-basis: 25%;
position: relative;
}
.step::before {
content: "";
position: absolute;
top: 10px;
left: 50%;
transform: translateX(-50%);
width: 30px;
height: 30px;
border-radius: 50%;
background-color: #f2f2f2;
border: 2px solid #ddd;
}
.step.active::before {
background-color: #4286f4;
border-color: #4286f4;
}
.step::after {
content: "";
position: absolute;
top: 25px;
left: calc(50% + 15px);
height: 2px;
width: calc(100% - 30px);
background-color: #f2f2f2;
}
.step.active::after {
background-color: #4286f4;
}
</style>
</head>
<body>
<div class="progress-container">
<div class="step active">Step 1</div>
<div class="step">Step 2</div>
<div class="step">Step 3</div>
<div class="step">Step 4</div>
</div>
<script>
// JavaScript Code
const steps = document.querySelectorAll('.step');
function updateProgress(selectedIndex) {
steps.forEach((step, index) => {
if (index <= selectedIndex) {
step.classList.add('active');
} else {
step.classList.remove('active');
}
});
}
</script>
</body>
</html>
.............................................
Q36.
<!DOCTYPE html>
<html>
<head>
<style>
/* Tab Bar Styles */
.tab {
display: flex;
justify-content: center;
margin-bottom: 40px;
}
.tab button {
position: relative;
margin-right: 20px;
padding: 10px 20px;
font-size: 20px;
font-weight: bold;
background-color: transparent;
border: none;
cursor: pointer;
transition: all 0.3s ease-in-out;
}
.tab button:hover {
color: #4286f4;
}
.tab button::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #f2f2f2;
border-radius: 10px;
z-index: -1;
transition: all 0.3s ease-in-out;
}
.tab button.active {
color: #fff;
}
.tab button.active::before {
background-color: #4286f4;
transform: scale(1.1);
}
.tab-content.active {
display: block;
}
</style>
</head>
<body>
<div class="tab">
<button class="active" data-tab="tab1">Tab 1</button>
<button data-tab="tab2">Tab 2</button>
<button data-tab="tab3">Tab 3</button>
</div>
<script>
// JavaScript Code
const tabs = document.querySelectorAll('.tab button');
const tabContents = document.querySelectorAll('.tab-content');
tabs.forEach((tab) => {
tab.addEventListener('click', () => {
const selectedTab = tab.dataset.tab;
.......................................................
Q35.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Image Color Picker</title>
<style>
/* Styles for the color picker container and image */
#color-picker-container {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
#color-picker-container img {
width: 50%;
max-width: 500px;
height: auto;
}
<script>
// JavaScript code for image color picker
const img = document.querySelector('img');
const colorDisplay = document.querySelector('#color-display');
if (hexR.length === 1) {
hexR = "0" + hexR;
}
if (hexG.length === 1) {
hexG = "0" + hexG;
}
if (hexB.length === 1) {
hexB = "0" + hexB;
}
...................................................................
Q21.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Responsive Layout Design</title>
<style>
/* Container styles */
.container {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
/* Item styles */
.item {
flex: 1 1 300px; /* Set a fixed width of 300px for each item */
margin: 10px;
padding: 20px;
background-color: #f2f2f2;
border: 1px solid #ccc;
box-sizing: border-box;
}
/* Responsive styles */
@media screen and (max-width: 600px) {
/* Change to a single column layout on screens smaller than 600px */
.container {
flex-direction: column;
}
.item {
flex: 1 1 auto; /* Allow items to expand to full width */
}
}
</style>
</head>
<body>
<div class="container">
<div class="item">
<h2>Item 1</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div class="item">
<h2>Item 2</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div class="item">
<h2>Item 3</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div class="item">
<h2>Item 4</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div class="item">
<h2>Item 5</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div class="item">
<h2>Item 6</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
</div>
</body>
</html>
.........................................................
........................................
Q32.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<style>
.container {
width: 300px;
margin: 0 auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
}
h1 {
text-align: center;
}
label, input {
display: block;
margin-bottom: 10px;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 5px;
}
button {
width: 100%;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<div class="container">
<h1>Login</h1>
<form id="login-form">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
<button type="submit">Login</button>
</form>
</div>
<script>
document.getElementById("login-form").addEventListener("submit",
function(event) {
event.preventDefault(); // Prevent form submission
........................................