Menu Code
Menu Code
-->
<html>
<head>
<script>
</script>
</head>
<body>
<div>
<h3>Menu</h3>
<ul>
</ul>
</div>
</body>
</html>
-->
<!-- Chain menu -->
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
margin: 20px;
select {
padding: 10px;
font-size: 16px;
margin-top: 10px;
</style>
</head>
<body>
<option value="Maharashtra">Maharashtra</option>
<option value="Gujarat">Gujarat</option>
<option value="Karnataka">Karnataka</option>
</select>
<select id="districtSelect">
</select>
<script>
const stateDistricts = {
};
function updateDistricts() {
if (selectedState) {
option.value = district;
option.textContent = district;
districtSelect.appendChild(option);
});
</script>
</body>
</html> -->
<html>
<head>
<script>
// Function to show the content of the clicked tab and hide others
function openTab(tabName) {
</script>
</head>
<body>
<br><br>
<h3>Tab 1 Content</h3>
</div>
<h3>Tab 2 Content</h3>
</div>
<h3>Tab 3 Content</h3>
</div>
<script>
document.getElementById("Tab1").style.display = "block";
</script>
</body>
</html>
-->
<!DOCTYPE html><!--
<html>
<head>
<style>
.popup-menu {
display: none;
position: absolute;
background-color: #f1f1f1;
padding: 10px;
</style>
<script>
function showMenu(event) {
menu.style.display = "block";
}
// Function to hide the pop-up menu
function hideMenu() {
document.getElementById("menu").style.display = "none";
document.onclick = hideMenu;
</script>
</head>
<body oncontextmenu="showMenu(event)">
<p>Option 1</p>
<p>Option 2</p>
<p>Option 3</p>
</div>
</body>
</html>
-->
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
margin: 0;
padding: 0;
.menu {
top: 0;
.menu a {
}
/* Change background color when hovering over links */
.menu a:hover {
.hamburger {
.menu.active {
</style>
</head>
<body>
<a href="http://www.msbte.org.in">Home</a>
<a href="#">About</a>
<a href="#">Services</a>
<a href="#">Contact</a>
</div>
<script>
function toggleMenu() {
</script>
</body>
</html>
-->
Highlighted menu
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Highlighted Menu</title>
<style>
ul {
list-style-type: none;
padding: 0;
li {
padding: 10px;
background-color: #f0f0f0;
margin-bottom: 5px;
cursor: pointer;
li:hover {
background-color: #3498db;
color: white;
</style>
</head>
<body>
<h2>Menu</h2>
<ul>
<li>Home</li>
<li>About</li>
<li>Services</li>
<li>Contact</li>
</ul>
</body>
</html>
Context menu
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
#contextMenu {
display: none;
position: absolute;
background-color: #ffffff;
z-index: 1000;
#contextMenu ul {
list-style-type: none;
margin: 0;
padding: 0;
#contextMenu ul li {
padding: 10px;
cursor: pointer;
background-color: #fff;
#contextMenu ul li:hover {
background-color: #3498db;
color: white;
}
</style>
</head>
<body>
<div id="contextMenu">
<ul>
</ul>
</div>
<script>
document.addEventListener("contextmenu", function(event) {
contextMenu.style.display = "block";
});
document.addEventListener("click", function() {
contextMenu.style.display = "none";
});
</script>
</body>
</html>
Scrollable menu
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Scrollable Menu</title>
<style>
ul {
list-style-type: none;
padding: 0;
margin: 0;
width: 200px;
/* Menu container */
.menu {
}
/* Styling for individual menu items */
li {
padding: 10px;
background-color: #f0f0f0;
margin-bottom: 2px;
cursor: pointer;
li:hover {
background-color: #3498db;
color: white;
</style>
</head>
<body>
<div class="menu">
<ul>
<li>Home</li>
<li>About</li>
<li>Services</li>
<li>Contact</li>
<li>Blog</li>
<li>Portfolio</li>
<li>Testimonials</li>
<li>Careers</li>
<li>Support</li>
<li>Terms of Service</li>
</ul>
</div>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Sidebar Menu</title>
<style>
body {
margin: 0;
padding: 0;
.content {
margin-left: 250px; /* Shift the content to make space for the sidebar */
padding: 20px;
/* Sidebar container */
.sidebar {
height: 100%; /* Full height */
top: 0;
left: 0;
background-color: #333;
padding-top: 20px;
/* Sidebar links */
.sidebar a {
text-decoration: none;
font-size: 18px;
color: white;
display: block;
.sidebar a:hover {
background-color: #575757;
.toggle-btn {
position: absolute;
top: 20px;
left: 260px;
font-size: 20px;
cursor: pointer;
color: #333;
background-color: #ddd;
padding: 10px;
border-radius: 5px;
.collapsed {
width: 0;
.collapsed + .content {
margin-left: 0;
left: 10px;
</style>
</head>
<body>
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Services</a>
<a href="#">Contact</a>
<a href="#">Blog</a>
</div>
<div class="content">
</div>
<script>
toggleBtn.addEventListener('click', function () {
sidebar.classList.toggle('collapsed');
});
</script>
</body>
</html>